Skip to content

Commit

Permalink
test: use regex error checks in test-util-format
Browse files Browse the repository at this point in the history
Replace constructor with regular expression for second argument
to assert.throws() in test-util-format.

PR-URL: nodejs#14299
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
superwoods authored and Trott committed Jul 17, 2017
1 parent 3f7216c commit 24f79a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-util-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ assert.strictEqual(util.format('%s', symbol), 'Symbol(foo)');
assert.strictEqual(util.format('%j', symbol), 'undefined');
assert.throws(function() {
util.format('%d', symbol);
}, TypeError);
}, /^TypeError: Cannot convert a Symbol value to a number$/);

// Number format specifier
assert.strictEqual(util.format('%d'), '%d');
Expand Down

0 comments on commit 24f79a7

Please sign in to comment.