diff --git a/test/parallel/test-repl-syntax-error-stack.js b/test/parallel/test-repl-syntax-error-stack.js index 462deb5fb67e1f..3f55959fda067e 100644 --- a/test/parallel/test-repl-syntax-error-stack.js +++ b/test/parallel/test-repl-syntax-error-stack.js @@ -11,7 +11,12 @@ process.on('exit', () => { }); common.ArrayStream.prototype.write = function(output) { - if (/var foo bar;/.test(output)) + // Matching only on a minimal piece of the stack because the string will vary + // greatly depending on the JavaScript engine. V8 includes `;` because it + // displays the line of code (`var foo bar;`) that is causing a problem. + // ChakraCore does not display the line of code but includes `;` in the phrase + // `Expected ';' `. + if (/;/.test(output)) found = true; };