From d1a8588cabbc7a77991ecf1f4542f51c0ee4fd78 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 14 Feb 2017 21:55:50 -0800 Subject: [PATCH] test: improve message in net-connect-local-error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-net-connect-local-error can fail with messages that report `AssertionError: undefined === 12346`. Unfortunately, this doesn't provide sufficient information to identify what went wrong with the test. Increase information provided. PR-URL: https://github.com/nodejs/node/pull/11393 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca --- test/parallel/test-net-connect-local-error.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-net-connect-local-error.js b/test/parallel/test-net-connect-local-error.js index 197b283bdf3621..2a0c20f6ea4a5e 100644 --- a/test/parallel/test-net-connect-local-error.js +++ b/test/parallel/test-net-connect-local-error.js @@ -10,6 +10,14 @@ var client = net.connect({ }); client.on('error', common.mustCall(function onError(err) { - assert.equal(err.localPort, common.PORT); - assert.equal(err.localAddress, common.localhostIPv4); + assert.strictEqual( + err.localPort, + common.PORT, + `${err.localPort} !== ${common.PORT} in ${err}` + ); + assert.strictEqual( + err.localAddress, + common.localhostIPv4, + `${err.localAddress} !== ${common.localhostIPv4} in ${err}` + ); }));