From 5f20d62c8fd89379b35bfa4610ff34551b4f1892 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 f28c3503233da7..8d0e336aad844d 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -387,7 +387,8 @@ assert.throws(makeBlock(thrower, TypeError)); '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(); });