Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e8eed5c

Browse filesBrowse files
TrottBethGriggs
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 <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>
1 parent 7d0970c commit e8eed5c
Copy full SHA for e8eed5c

File tree

Expand file treeCollapse file tree

1 file changed

+1
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-3
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-http-destroyed-socket-write2.js
+1-3Lines changed: 1 addition & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.