fist commit
This commit is contained in:
commit
a27fca4dea
17 changed files with 5033 additions and 0 deletions
__tests__
31
__tests__/cli-integration.test.ts
Normal file
31
__tests__/cli-integration.test.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { system, filesystem } from 'gluegun'
|
||||
|
||||
const src = filesystem.path(__dirname, '..')
|
||||
|
||||
const cli = async (cmd) =>
|
||||
system.run(
|
||||
'node ' + filesystem.path(src, 'bin', 'docker-volume-manager') + ` ${cmd}`
|
||||
)
|
||||
|
||||
test('outputs version', async () => {
|
||||
const output = await cli('--version')
|
||||
expect(output).toContain('0.0.1')
|
||||
})
|
||||
|
||||
test('outputs help', async () => {
|
||||
const output = await cli('--help')
|
||||
expect(output).toContain('0.0.1')
|
||||
})
|
||||
|
||||
test('generates file', async () => {
|
||||
const output = await cli('generate foo')
|
||||
|
||||
expect(output).toContain('Generated file at models/foo-model.ts')
|
||||
const foomodel = filesystem.read('models/foo-model.ts')
|
||||
|
||||
expect(foomodel).toContain(`module.exports = {`)
|
||||
expect(foomodel).toContain(`name: 'foo'`)
|
||||
|
||||
// cleanup artifact
|
||||
filesystem.remove('models')
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue