Skip to content

Commit 025eadf

Browse files
Trottevanlucas
authored andcommitted
test: make test-console-count 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 c74467f commit 025eadf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/parallel/test-console-count.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ assert.strictEqual(buf, 'default: 2\n');
5454

5555
process.stdout.write = stdoutWrite;
5656

57-
// Symbol labels do not work
57+
// Symbol labels do not work. Only check that the `Error` is a `TypeError`. Do
58+
// not check the message because it is different depending on the JavaScript
59+
// engine.
5860
assert.throws(
5961
() => console.count(Symbol('test')),
60-
/^TypeError: Cannot convert a Symbol value to a string$/);
62+
TypeError);
6163
assert.throws(
6264
() => console.countReset(Symbol('test')),
63-
/^TypeError: Cannot convert a Symbol value to a string$/);
65+
TypeError);

0 commit comments

Comments
 (0)