refactored tests and added docker build test, repaired state.network

This commit is contained in:
Nikola Jokic
2022-06-03 14:10:15 +02:00
parent 8bc1fbbec5
commit 4b7efe88ef
9 changed files with 204 additions and 113 deletions

View File

@@ -0,0 +1,33 @@
import * as fs from 'fs'
import { containerBuild } from '../src/dockerCommands'
import TestSetup from './test-setup'
let testSetup
let runContainerStepDefinition
const runContainerStepInputPath = `${__dirname}/../../../examples/run-container-step.json`
describe('container build', () => {
beforeEach(() => {
testSetup = new TestSetup()
testSetup.initialize()
let runContainerStepJson = fs.readFileSync(
runContainerStepInputPath,
'utf8'
)
runContainerStepDefinition = JSON.parse(runContainerStepJson.toString())
runContainerStepDefinition.image = ''
const actionPath = testSetup.initializeDockerAction()
runContainerStepDefinition.dockerfile = `${actionPath}/Dockerfile`
})
afterEach(() => {
testSetup.teardown()
})
it('should build container', async () => {
await expect(
containerBuild(runContainerStepDefinition, 'example-test-tag')
).resolves.not.toThrow()
})
})