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 <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
addaleax authored and targos committed Sep 2, 2018
1 parent 17bc49e commit 170c7e7
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 170c7e7

Please sign in to comment.