summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-10-17 15:41:39 -0700
committerJames M Snell <jasnell@gmail.com>2017-11-11 17:40:22 -0800
commitc38c31812e786324cd7b87daf67c771b41534370 (patch)
tree1782de9024b49ea06ca2b867f118f69b0473ada1 /test
parent90c9b162fe7885eb4d783f19bc89fb1f85af16be (diff)
downloadandroid-node-v8-c38c31812e786324cd7b87daf67c771b41534370.tar.gz
android-node-v8-c38c31812e786324cd7b87daf67c771b41534370.tar.bz2
android-node-v8-c38c31812e786324cd7b87daf67c771b41534370.zip
test: make test-console 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 `TypeError`. 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-console.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js
index cc1d3fb834..b3d3dedb72 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