Skip to content

Commit bbe3288

Browse files
superwoodsMylesBorins
authored andcommitted
test: use regex error checks in test-util-format
Replace constructor with regular expression for second argument to assert.throws() in test-util-format. PR-URL: #14299 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent a696e2e commit bbe3288

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: test/parallel/test-util-format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ assert.strictEqual(util.format('%s', symbol), 'Symbol(foo)');
2525
assert.strictEqual(util.format('%j', symbol), 'undefined');
2626
assert.throws(function() {
2727
util.format('%d', symbol);
28-
}, TypeError);
28+
}, /^TypeError: Cannot convert a Symbol value to a number$/);
2929

3030
assert.strictEqual(util.format('%d', 42.0), '42');
3131
assert.strictEqual(util.format('%d', 42), '42');

0 commit comments

Comments
 (0)