Skip to content

Commit

Permalink
test: convert assertion that always fails to assert.fail()
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
Trott committed Aug 18, 2020
1 parent 15fdd98 commit aa5361c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/parallel/test-http-destroyed-socket-write2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}


Expand Down

0 comments on commit aa5361c

Please sign in to comment.