diff --git a/test/parallel/test-cli-syntax.js b/test/parallel/test-cli-syntax.js index 1ac209b5abb091..0b1010c4dad2ec 100644 --- a/test/parallel/test-cli-syntax.js +++ b/test/parallel/test-cli-syntax.js @@ -13,7 +13,9 @@ const syntaxArgs = [ ['--check'] ]; -const syntaxErrorRE = /^SyntaxError: Unexpected identifier$/m; +// Match on the name of the `Error` but not the message as it is different +// depending on the JavaScript engine. +const syntaxErrorRE = /^SyntaxError: \b/m; const notFoundRE = /^Error: Cannot find module/m; // test good syntax with and without shebang