Skip to content

Commit

Permalink
test: improve message in net-connect-local-error
Browse files Browse the repository at this point in the history
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: #11393
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Mar 9, 2017
1 parent 6677c11 commit d9deb1f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/parallel/test-net-connect-local-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
);
}));

0 comments on commit d9deb1f

Please sign in to comment.