Skip to content

Instantly share code, notes, and snippets.

@lrlna
Created February 13, 2016 20:16
Show Gist options
  • Save lrlna/79145b5f480bdb672ff2 to your computer and use it in GitHub Desktop.
Save lrlna/79145b5f480bdb672ff2 to your computer and use it in GitHub Desktop.
it('fails with invalid command', function (done) {
yargs('marsupial -w 10')
.command('marsupial', 'wombat burrows', function (yargs, argv) {
console.log(argv)
return argv
})
.demand(1, ['w', 'b'])
.strict()
.fail(function (msg) {
msg.should.equal('Missing required argument: b')
return done()
})
.argv
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment