Skip to content

Commit 3bfc187

Browse files
TrottFishrock123
authored andcommitted
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent 921fb54 commit 3bfc187

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
@@ -44,7 +44,8 @@ var notSocketClient = net.createConnection(emptyTxt, function() {
4444
});
4545

4646
notSocketClient.on('error', function(err) {
47-
assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED');
47+
assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED',
48+
`received ${err.code} instead of ENOTSOCK or ECONNREFUSED`);
4849
notSocketErrorFired = true;
4950
});
5051

0 commit comments

Comments
 (0)