Created
May 19, 2017 13:53
-
-
Save chris-olszewski/712ed0fe6263e54c6a710d5dfea0b788 to your computer and use it in GitHub Desktop.
Command test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test from 'ava' | |
import td from '../helpers/testdouble' | |
import yargs from 'yargs' | |
const _new = td.replace('../../src/new') | |
const parser = yargs.command(require('../../src/commands/new')).help() | |
const projectName = 'my_project' | |
const roleName = 'shepRole' | |
const region = 'mordor' | |
test('Runs as expected', (t) => { | |
const command = `new ${projectName} --rolename ${roleName} --region ${region}` | |
parser.parse(command, (err, agv, output) => { | |
console.log(output, agv) | |
if (err) t.fail() | |
td.verify(_new(td.matchers.contains({ path: projectName, rolename: roleName, region }))) | |
t.pass() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment