Skip to content

Commit 1ae0e35

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
test: improve assert message
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: #4461 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent bf56d50 commit 1ae0e35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-net-pipe-connect-errors.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ var notSocketClient = net.createConnection(emptyTxt, function() {
4242
});
4343

4444
notSocketClient.on('error', function(err) {
45-
assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED');
45+
assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED',
46+
`received ${err.code} instead of ENOTSOCK or ECONNREFUSED`);
4647
notSocketErrorFired = true;
4748
});
4849

0 commit comments

Comments
 (0)