Skip to content

Commit

Permalink
test: improve assertions in test-cli-node-print-help
Browse files Browse the repository at this point in the history
PR-URL: #22489
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
  • Loading branch information
addaleax committed Sep 2, 2018
1 parent 1126dfe commit 208022c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-cli-node-print-help.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ function validateNodePrintHelp() {
function testForSubstring(options) {
if (options.compileConstant) {
options.flags.forEach((flag) => {
assert.strictEqual(stdOut.indexOf(flag) !== -1, true);
assert.strictEqual(stdOut.indexOf(flag) !== -1, true,
`Missing flag ${flag} in ${stdOut}`);
});
} else {
options.flags.forEach((flag) => {
assert.strictEqual(stdOut.indexOf(flag), -1);
assert.strictEqual(stdOut.indexOf(flag), -1,
`Unexpected flag ${flag} in ${stdOut}`);
});
}
}
Expand Down

0 comments on commit 208022c

Please sign in to comment.