From ac776f43f45df82aa43fe63a52c5bedc88aae235 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 15 Aug 2020 17:36:58 -0700 Subject: [PATCH] test: convert assertion that always fails to assert.fail() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: Michaël Zasso Reviewed-By: Tobias Nießen Reviewed-By: James M Snell --- test/parallel/test-http-destroyed-socket-write2.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/parallel/test-http-destroyed-socket-write2.js b/test/parallel/test-http-destroyed-socket-write2.js index 6878b16085f0c3..49594bde6daf1d 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -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}`); }