Skip to content

Commit 4604294

Browse files
Trottevanlucas
authored andcommitted
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: #16272 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 025eadf commit 4604294

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/parallel/test-console.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ assert.doesNotThrow(function() {
4242
console.timeEnd('label');
4343
});
4444

45+
// Check that the `Error` is a `TypeError` but do not check the message as it
46+
// will be different in different JavaScript engines.
4547
assert.throws(() => console.time(Symbol('test')),
46-
/^TypeError: Cannot convert a Symbol value to a string$/);
48+
TypeError);
4749
assert.throws(() => console.timeEnd(Symbol('test')),
48-
/^TypeError: Cannot convert a Symbol value to a string$/);
50+
TypeError);
4951

5052

5153
// an Object with a custom .inspect() function

0 commit comments

Comments
 (0)