diff --git a/test/parallel/test-debug-usage.js b/test/parallel/test-debug-usage.js index 4582ac7bb5b6e2..eb9594f236b35c 100644 --- a/test/parallel/test-debug-usage.js +++ b/test/parallel/test-debug-usage.js @@ -11,8 +11,7 @@ child.stderr.setEncoding('utf8'); const expectedLines = [ /^\(node:\d+\) \[DEP0068\] DeprecationWarning:/, - /^Usage: .*node.* debug script\.js$/, - /^ .*node.* debug :$/ + /Usage: .*node.* debug script\.js\r?\n .*node.* debug :\r?\n .*node.* debug -p \r?\n$/, ]; let actualUsageMessage = ''; @@ -21,11 +20,10 @@ child.stderr.on('data', function(data) { }); child.on('exit', common.mustCall(function(code) { - const outputLines = actualUsageMessage.split('\n'); assert.strictEqual(code, 1); for (let i = 0; i < expectedLines.length; i++) assert.ok( - expectedLines[i].test(outputLines[i]), - `${outputLines[i]} did not match ${expectedLines[i]}` + expectedLines[i].test(actualUsageMessage), + `${actualUsageMessage} did not match ${expectedLines[i]}` ); }));