Skip to content

Commit

Permalink
Add test for empty option on command
Browse files Browse the repository at this point in the history
Fixes tj#727
  • Loading branch information
Ben Sorohan committed Dec 4, 2017
1 parent 6864c95 commit faed894
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 faed894

Please sign in to comment.