Skip to content

Commit

Permalink
test: make test-console-count engine agnostic
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Trott authored and evanlucas committed Nov 13, 2017
1 parent c74467f commit 025eadf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/parallel/test-console-count.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 025eadf

Please sign in to comment.