From 04ed1865bf1604d765b64498fcb2c35bd7cfa5fa Mon Sep 17 00:00:00 2001 From: Superwoods Date: Sun, 16 Jul 2017 17:24:34 +0800 Subject: [PATCH] test: use regex error checks in test-util-format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace constructor with regular expression for second argument to assert.throws() in test-util-format. PR-URL: https://github.com/nodejs/node/pull/14299 Reviewed-By: Rich Trott Reviewed-By: Gibson Fahnestock Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Refael Ackermann Reviewed-By: Gireesh Punathil --- test/parallel/test-util-format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-util-format.js b/test/parallel/test-util-format.js index 71265e4b6a37f8..96856de7bf1b5c 100644 --- a/test/parallel/test-util-format.js +++ b/test/parallel/test-util-format.js @@ -25,7 +25,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$/); assert.strictEqual(util.format('%d', 42.0), '42'); assert.strictEqual(util.format('%d', 42), '42');