From 025eadfcd5226e319b89e1e5774096bff702a7b8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 17 Oct 2017 15:38:02 -0700 Subject: [PATCH] test: make test-console-count 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-console-count.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-console-count.js b/test/parallel/test-console-count.js index 64e2641f0a641d..5c7b26aaa20d00 100644 --- a/test/parallel/test-console-count.js +++ b/test/parallel/test-console-count.js @@ -54,10 +54,12 @@ assert.strictEqual(buf, 'default: 2\n'); process.stdout.write = stdoutWrite; -// Symbol labels do not work +// Symbol labels do not work. Only check that the `Error` is a `TypeError`. Do +// not check the message because it is different depending on the JavaScript +// engine. assert.throws( () => console.count(Symbol('test')), - /^TypeError: Cannot convert a Symbol value to a string$/); + TypeError); assert.throws( () => console.countReset(Symbol('test')), - /^TypeError: Cannot convert a Symbol value to a string$/); + TypeError);