mirror of
https://github.com/trympet/nextcloud-artifacts-action.git
synced 2025-07-27 03:13:18 +02:00
add simple integration test
This commit is contained in:
37
__tests__/doubles/InputsDouble.ts
Normal file
37
__tests__/doubles/InputsDouble.ts
Normal 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
|
||||
}
|
||||
}
|
0
__tests__/fixtures/test-artifact/a.txt
Normal file
0
__tests__/fixtures/test-artifact/a.txt
Normal file
0
__tests__/fixtures/test-artifact/some-folder/b.txt
Normal file
0
__tests__/fixtures/test-artifact/some-folder/b.txt
Normal file
9
__tests__/integration.test.ts
Normal file
9
__tests__/integration.test.ts
Normal 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
1
__tests__/setup.ts
Normal file
@@ -0,0 +1 @@
|
||||
require("dotenv").config()
|
Reference in New Issue
Block a user