From e875e9aea96b6e5901729efd43f4445eeba0757a Mon Sep 17 00:00:00 2001 From: Superwoods Date: Sun, 16 Jul 2017 17:24:34 +0800 Subject: [PATCH] test: use regex with assert.throws - from JSconfCN 2017 code learn workshop --- 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 084e6f73b90ddf..4527bf40e441fa 100644 --- a/test/parallel/test-util-format.js +++ b/test/parallel/test-util-format.js @@ -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');