Skip to content

Commit

Permalink
Add test to check boolean flag type enforcement (#75)
Browse files Browse the repository at this point in the history
Resolves #74
  • Loading branch information
macklinu authored and sindresorhus committed Apr 25, 2018
1 parent 8c82a18 commit 51ce745
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ test('type inference', t => {
}).input[0], 5);
});

test('enforces boolean flag type', t => {
const cli = m(``, {
argv: ['--cursor=false'],
flags: {
cursor: {type: 'boolean'}
}
});
t.deepEqual(cli.flags, {cursor: false});
});

test('accept help and options', t => {
t.deepEqual(m('help', {
argv: ['-f'],
Expand Down

0 comments on commit 51ce745

Please sign in to comment.