Skip to content

Commit

Permalink
test for setting a boolean to a null default
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Mar 10, 2015
1 parent e2563e4 commit 8c444fe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/default_bool.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,18 @@ test('boolean default false', function (t) {
t.equal(argv.somefalse, false);
t.end();
});

test('boolean default to null', function (t) {
var argv = parse([], {
boolean: 'maybe',
default: { maybe: null }
});
t.equal(argv.maybe, null);
var argv = parse(['--maybe'], {
boolean: 'maybe',
default: { maybe: null }
});
t.equal(argv.maybe, true);
t.end();

})

0 comments on commit 8c444fe

Please sign in to comment.