From 1ae0e355b974aca95a9f33c108e99be7c41e6c06 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 28 Dec 2015 21:28:36 -0800 Subject: [PATCH] test: improve assert message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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(-) diff --git a/test/parallel/test-net-pipe-connect-errors.js b/test/parallel/test-net-pipe-connect-errors.js index 81ad90e..dbc7967 100644 --- a/test/parallel/test-net-pipe-connect-errors.js +++ b/test/parallel/test-net-pipe-connect-errors.js @@ -42,7 +42,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; }); -- 2.7.4