From 28e9a022df3ef89a0ea21e4ad86655eb408a8d96 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Tue, 20 Oct 2015 11:40:54 -0700 Subject: test: wrap assert.fail when passed to callback Currently there are many instances where assert.fail is directly passed to a callback for error handling. Unfortunately this will swallow the error as it is the third argument of assert.fail that sets the message not the first. This commit adds a new function to test/common.js that simply wraps assert.fail and calls it with the provided message. Tip of the hat to @trott for pointing me in the direction of this. PR-URL: https://github.com/nodejs/node/pull/3453 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott --- test/parallel/test-tls-cipher-list.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/parallel/test-tls-cipher-list.js') diff --git a/test/parallel/test-tls-cipher-list.js b/test/parallel/test-tls-cipher-list.js index 9ae8fefa0f..f20a0a6a24 100644 --- a/test/parallel/test-tls-cipher-list.js +++ b/test/parallel/test-tls-cipher-list.js @@ -17,12 +17,12 @@ function doCheck(arg, check) { 'require("constants").defaultCipherList' ]); spawn(process.execPath, arg, {}). - on('error', assert.fail). + on('error', common.fail). stdout.on('data', function(chunk) { out += chunk; }).on('end', function() { assert.equal(out.trim(), check); - }).on('error', assert.fail); + }).on('error', common.fail); } // test the default unmodified version -- cgit v1.2.3