diff options
author | Rich Trott <rtrott@gmail.com> | 2017-10-17 15:34:53 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-11-11 17:40:12 -0800 |
commit | b786ed99c126e70c06b64bbc50b97f34390a3755 (patch) | |
tree | 0423f174858bd85ae2f449ef25e01e5fcc7b42f4 /test | |
parent | 7baf261cfc36daa3bfb219a0f10465eef3067197 (diff) | |
download | android-node-v8-b786ed99c126e70c06b64bbc50b97f34390a3755.tar.gz android-node-v8-b786ed99c126e70c06b64bbc50b97f34390a3755.tar.bz2 android-node-v8-b786ed99c126e70c06b64bbc50b97f34390a3755.zip |
test: make test-cli-syntax engine agnostic
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 <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-cli-syntax.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/parallel/test-cli-syntax.js b/test/parallel/test-cli-syntax.js index 1ac209b5ab..0b1010c4da 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 |