From c74467f938dc63236a6c359b1fb26d2f4af504cc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 17 Oct 2017 15:34:53 -0700 Subject: [PATCH] test: make test-cli-syntax engine agnostic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not check the error message if it is generated by the JavaScript engine (V8, ChakraCore, etc.). Do confirm that it is a `SyntaxError`. PR-URL: https://github.com/nodejs/node/pull/16272 Reviewed-By: Michaël Zasso Reviewed-By: Refael Ackermann Reviewed-By: Yuta Hiroto Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Tobias Nießen --- test/parallel/test-cli-syntax.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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