From c81b08692851c4648dc868afa85a7a4dfb09849b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 17 Oct 2017 16:29:32 -0700 Subject: [PATCH] test: make test-repl-harmony 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 `TypeError`. 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-repl-harmony.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-repl-harmony.js b/test/parallel/test-repl-harmony.js index 553eca844fce19..5867a8caff569e 100644 --- a/test/parallel/test-repl-harmony.js +++ b/test/parallel/test-repl-harmony.js @@ -28,7 +28,9 @@ const args = ['-i']; const child = spawn(process.execPath, args); const input = '(function(){"use strict"; const y=1;y=2})()\n'; -const expectOut = /^> TypeError: Assignment to constant variable\.\n/; +// This message will vary based on JavaScript engine, so don't check the message +// contents beyond confirming that the `Error` is a `TypeError`. +const expectOut = /^> TypeError: /; child.stderr.setEncoding('utf8'); child.stderr.on('data', function(c) {