Skip to content

Commit 987f289

Browse files
authored
Use simple match in test (to avoid warning about expensive regex) (#2485)
* Use simple match in test (to avoid warning about expensive regex) * Improve clarity * Remove unnecessary extra option in test
1 parent 0ea3bb3 commit 987f289

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/command.help.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ Commands:
120120
const program = new commander.Command();
121121
program.option('-h, --host', 'select host');
122122
const helpInformation = program.helpInformation();
123-
assert(!/\W-h\W.*display help/.test(helpInformation));
123+
assert(helpInformation.includes(' -h, --host'));
124+
assert(!helpInformation.includes(' -h, --help'));
125+
assert(helpInformation.includes(' --help'));
124126
});
125127

126128
test('when both help flags masked then not displayed in helpInformation', () => {

0 commit comments

Comments
 (0)