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 3, 2018
1 parent 7d8ef42 commit d3740d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-cli-node-print-help.js
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 d3740d8

Please sign in to comment.