test: improve assertions in test-cli-node-print-help
PR-URL: https://github.com/nodejs/node/pull/22489 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
parent
1126dfe0cb
commit
208022cb31
@ -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}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user