Files
runner-container-hooks/packages/docker/tests/cleanup-job-test.ts
T

34 lines
741 B
TypeScript
Raw Normal View History

import { PrepareJobArgs } from 'hooklib/lib'
import { cleanupJob, prepareJob } from '../src/hooks'
2022-06-02 15:53:11 -04:00
import TestSetup from './test-setup'
let testSetup: TestSetup
jest.useRealTimers()
describe('cleanup job', () => {
beforeEach(async () => {
testSetup = new TestSetup()
testSetup.initialize()
const prepareJobDefinition = testSetup.getPrepareJobDefinition()
2022-06-02 15:53:11 -04:00
2022-06-08 13:20:54 +02:00
const prepareJobOutput = testSetup.createOutputFile(
'prepare-job-output.json'
)
await prepareJob(
prepareJobDefinition.args as PrepareJobArgs,
prepareJobOutput
)
2022-06-02 15:53:11 -04:00
})
afterEach(() => {
testSetup.teardown()
})
it('should cleanup successfully', async () => {
await expect(cleanupJob()).resolves.not.toThrow()
2022-06-02 15:53:11 -04:00
})
})