npmci/ts/npmci.test.ts

33 lines
870 B
TypeScript
Raw Normal View History

2016-11-24 22:21:40 +00:00
import * as plugins from './npmci.plugins'
2017-03-08 13:50:41 +00:00
import { bash } from './npmci.bash'
import { install } from './npmci.install'
2016-11-24 22:21:40 +00:00
import * as env from './npmci.env'
import * as NpmciBuildDocker from './npmci.build.docker'
2016-05-30 01:40:07 +00:00
2017-03-08 13:50:41 +00:00
export let test = async (versionArg): Promise<void> => {
if (versionArg === 'docker') {
await testDocker()
} else {
await install(versionArg)
.then(npmDependencies)
.then(npmTest)
}
}
2017-03-08 13:50:41 +00:00
let npmDependencies = async () => {
plugins.beautylog.info('now installing dependencies:')
await bash('npm install')
}
2017-03-08 13:50:41 +00:00
let npmTest = async () => {
plugins.beautylog.info('now starting tests:')
await bash('npm test')
}
2017-03-08 13:50:41 +00:00
let testDocker = async (): Promise<NpmciBuildDocker.Dockerfile[]> => {
return await NpmciBuildDocker.readDockerfiles()
.then(NpmciBuildDocker.pullDockerfileImages)
.then(NpmciBuildDocker.testDockerfiles)
2016-06-07 02:31:25 +00:00
}