Skip to content

Commit ac776f4

Browse files
Trottaddaleax
authored andcommitted
test: convert assertion that always fails to assert.fail()
In test-http-destroyed-socket-write2, the assert.strictEqual() in the default case of the switch statement will always fail because it checks for a value that is already accounted for in one of the switch cases. Convert it to assert.fail(). PR-URL: #34793 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 05dae02 commit ac776f4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/parallel/test-http-destroyed-socket-write2.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ server.listen(0, function() {
6464

6565
default:
6666
// Write to a torn down client should RESET or ABORT
67-
assert.strictEqual(er.code,
68-
'ECONNRESET');
69-
break;
67+
assert.fail(`Unexpected error code ${er.code}`);
7068
}
7169

7270

0 commit comments

Comments
 (0)