add simple integration test

This commit is contained in:
Trym Lund Flogard
2021-06-05 13:09:07 +02:00
parent 518c6f09f4
commit 7a45cee3de
8 changed files with 83 additions and 35 deletions

View File

@@ -0,0 +1,37 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { Inputs } from '../../src/Inputs'
import { NoFileOption } from '../../src/NoFileOption'
export class InputsDouble implements Inputs {
get ArtifactName(): string {
return process.env['ARTIFACT_NAME']!
}
get ArtifactPath(): string {
return process.env['ARTIFACT_PATH']!
}
get Retention(): string {
return ''
}
get Endpoint(): string {
return process.env['ENDPOINT']!
}
get Username(): string {
return process.env['USERNAME']!
}
get Password(): string {
return process.env['PASSWORD']!
}
get Token(): string {
return process.env['TOKEN']!
}
get NoFileBehvaior(): NoFileOption {
return NoFileOption.error
}
}

View File

View File

@@ -0,0 +1,9 @@
import { NextcloudArtifact } from '../src/nextcloud/NextcloudArtifact'
import { InputsDouble } from './doubles/InputsDouble'
describe('integration tests', () => {
it('works', async () => {
const artifact = new NextcloudArtifact(new InputsDouble())
await artifact.run()
})
})

1
__tests__/setup.ts Normal file
View File

@@ -0,0 +1 @@
require("dotenv").config()