Skip to content

Commit aea0d50

Browse files
Trottitaloacasas
authored andcommitted
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. 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]>
1 parent 4366ab5 commit aea0d50

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/parallel/test-net-connect-local-error.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ const client = net.connect({
1010
});
1111

1212
client.on('error', common.mustCall(function onError(err) {
13-
assert.strictEqual(err.localPort, common.PORT);
14-
assert.strictEqual(err.localAddress, common.localhostIPv4);
13+
assert.strictEqual(
14+
err.localPort,
15+
common.PORT,
16+
`${err.localPort} !== ${common.PORT} in ${err}`
17+
);
18+
assert.strictEqual(
19+
err.localAddress,
20+
common.localhostIPv4,
21+
`${err.localAddress} !== ${common.localhostIPv4} in ${err}`
22+
);
1523
}));

0 commit comments

Comments
 (0)