summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-10-17 16:39:07 -0700
committerEvan Lucas <evanlucas@me.com>2017-11-13 07:59:53 -0600
commitf8337cea8e162e15d5acb415cbc30afcb9cf587b (patch)
tree83d992f7180f5123b3b5202d8de569065f87a429
parentc81b08692851c4648dc868afa85a7a4dfb09849b (diff)
downloadnode-new-f8337cea8e162e15d5acb415cbc30afcb9cf587b.tar.gz
test: make test-repl-syntax-error-stack agnostic
Revise test so that it does not depend on behavior specific to V8. 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>
-rw-r--r--test/parallel/test-repl-syntax-error-stack.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/parallel/test-repl-syntax-error-stack.js b/test/parallel/test-repl-syntax-error-stack.js
index 462deb5fb6..3f55959fda 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;
};