From 9786ec7e0459202a4f2cedf694d334748d2a16a1 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 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. --- 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 23bfacde336f36..f23245ac93a49f 100644 --- a/test/parallel/test-net-connect-local-error.js +++ b/test/parallel/test-net-connect-local-error.js @@ -10,6 +10,14 @@ const client = net.connect({ }); client.on('error', common.mustCall(function onError(err) { - assert.strictEqual(err.localPort, common.PORT); - assert.strictEqual(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}` + ); }));