Skip to content

Commit

Permalink
remove redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eegli committed Oct 5, 2024
1 parent dc27c9d commit 92f3341
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions test/e2e/docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,37 +393,6 @@ describe('docs', () => {
});
});
describe('subparsers', () => {
test('default', async () => {
const subparser = new Parser()
.option('greeting', {
longFlag: '--greeting',
shortFlag: '-g',
defaultValue: '',
})
.defaultHandler(({ options }) => {
console.log(options.greeting);
});

const parser = new Parser()
.option('greeting', {
longFlag: '--greeting',
shortFlag: '-g',
defaultValue: '',
})
.subparser('v2', {
parser: subparser,
description: 'Version 2 of this CLI',
})
.defaultHandler(({ options }) => {
console.log(options.greeting);
});

await parser.parse(['-g', 'hello from the main parser']).call();
expect(consoleLog).toHaveBeenLastCalledWith('hello from the main parser');

await parser.parse(['v2', '-g', 'hello from the subparser']).call();
expect(consoleLog).toHaveBeenLastCalledWith('hello from the subparser');
});
test('with shared options', async () => {
type CommonOptions = {
verbose: boolean;
Expand Down

0 comments on commit 92f3341

Please sign in to comment.