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: https://github.com/nodejs/node/pull/34793
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rich Trott authored and Anna Henningsen committed 2020-09-22 19:55:44 +02:00
1 parent 05dae0231b
commit ac776f43f4
1 file changed
+1 -3
@@ -64,9 +64,7 @@ server.listen(0, function() {
default:
// Write to a torn down client should RESET or ABORT
assert.strictEqual(er.code,
'ECONNRESET');
break;
assert.fail(`Unexpected error code ${er.code}`);
}