From 4604294647a8a4a202bb9502f0565976d0ce0e12 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 17 Oct 2017 15:41:39 -0700 Subject: [PATCH] test: make test-console 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.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index cc1d3fb83412d1..b3d3dedb72e9bf 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -42,10 +42,12 @@ assert.doesNotThrow(function() { console.timeEnd('label'); }); +// Check that the `Error` is a `TypeError` but do not check the message as it +// will be different in different JavaScript engines. assert.throws(() => console.time(Symbol('test')), - /^TypeError: Cannot convert a Symbol value to a string$/); + TypeError); assert.throws(() => console.timeEnd(Symbol('test')), - /^TypeError: Cannot convert a Symbol value to a string$/); + TypeError); // an Object with a custom .inspect() function