From d0036c7ff522b09fc2ceed1281cde923fa08c8ee Mon Sep 17 00:00:00 2001 From: jobala Date: Wed, 1 Feb 2017 20:34:11 +0300 Subject: [PATCH] test: improve test-assert.js Verify error message thrown from assert.ifError PR-URL: https://github.com/nodejs/node/pull/11193 Reviewed-By: Joyee Cheung Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Yuta Hiroto Reviewed-By: Sakthipriyan Vairamani --- test/parallel/test-assert.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index eb983345418637..bcb802f3e69554 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -358,7 +358,8 @@ try { assert.equal(true, threw, 'a.doesNotThrow is not catching type matching errors'); -assert.throws(function() { assert.ifError(new Error('test error')); }); +assert.throws(function() { assert.ifError(new Error('test error')); }, + /^Error: test error$/); assert.doesNotThrow(function() { assert.ifError(null); }); assert.doesNotThrow(function() { assert.ifError(); });