Skip to content

Commit

Permalink
test: improve assert message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trott authored and Myles Borins committed Jan 19, 2016
1 parent bf56d50 commit 1ae0e35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-net-pipe-connect-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down

0 comments on commit 1ae0e35

Please sign in to comment.