2022-06-03 14:10:15 +02:00
|
|
|
import { containerBuild } from '../src/dockerCommands'
|
|
|
|
|
import TestSetup from './test-setup'
|
|
|
|
|
|
|
|
|
|
let testSetup
|
|
|
|
|
let runContainerStepDefinition
|
|
|
|
|
|
|
|
|
|
describe('container build', () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
testSetup = new TestSetup()
|
|
|
|
|
testSetup.initialize()
|
|
|
|
|
|
2022-06-15 03:41:49 +02:00
|
|
|
runContainerStepDefinition = testSetup.getRunContainerStepDefinition()
|
2022-06-03 14:10:15 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
|
testSetup.teardown()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
it('should build container', async () => {
|
2022-06-15 03:41:49 +02:00
|
|
|
runContainerStepDefinition.image = ''
|
|
|
|
|
const actionPath = testSetup.initializeDockerAction()
|
|
|
|
|
runContainerStepDefinition.dockerfile = `${actionPath}/Dockerfile`
|
2022-06-03 14:10:15 +02:00
|
|
|
await expect(
|
|
|
|
|
containerBuild(runContainerStepDefinition, 'example-test-tag')
|
|
|
|
|
).resolves.not.toThrow()
|
|
|
|
|
})
|
|
|
|
|
})
|