From 242d07890fbb17c9d7e9c8cd2090b069b37afa1b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 28 Dec 2015 21:28:36 -0800 Subject: test: improve assert message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improves the message when an assertion fires in the test-net-pipe-connect-errors so that it indicates the incorrect value received rather than merely reporting that the value is incorrect. PR-URL: https://github.com/nodejs/node/pull/4461 Reviewed-By: Johan Bergström Reviewed-By: Colin Ihrig Reviewed-By: Myles Borins --- test/parallel/test-net-pipe-connect-errors.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/parallel/test-net-pipe-connect-errors.js') diff --git a/test/parallel/test-net-pipe-connect-errors.js b/test/parallel/test-net-pipe-connect-errors.js index 0f4704ed19..8e341015d9 100644 --- a/test/parallel/test-net-pipe-connect-errors.js +++ b/test/parallel/test-net-pipe-connect-errors.js @@ -44,7 +44,8 @@ var notSocketClient = net.createConnection(emptyTxt, function() { }); notSocketClient.on('error', function(err) { - assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED'); + assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED', + `received ${err.code} instead of ENOTSOCK or ECONNREFUSED`); notSocketErrorFired = true; }); -- cgit v1.2.3