Skip to content

Commit

Permalink
Add test for empty option on command
Browse files Browse the repository at this point in the history
Fixes #727
  • Loading branch information
Ben Sorohan committed Jan 30, 2018
1 parent d5ac793 commit f44fa3b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test.command.action.emptyOption.js
@@ -0,0 +1,20 @@
/**
* Module dependencies.
*/

var program = require('../')
, should = require('should');

var val = "some cheese"
program
.name('test')
.command('mycommand')
.option('-c, --cheese [type]', 'optionally specify the type of cheese')
.action(function(cmd) {
val = cmd.cheese;
});

program.parse(['node', 'test', 'mycommand', '--cheese', '']);

val.should.equal('');

0 comments on commit f44fa3b

Please sign in to comment.