From 1ba8fbe4b82aea8a4e681a5cff6f47521561970d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9?= Date: Fri, 25 Oct 2024 12:39:45 -0500 Subject: [PATCH] test: increase test coverage for `http.OutgoingMessage.appendHeader()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juan José Arboleda PR-URL: https://github.com/nodejs/node/pull/55467 Reviewed-By: James M Snell Reviewed-By: Ulises Gascón --- test/parallel/test-http-multiple-headers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-http-multiple-headers.js b/test/parallel/test-http-multiple-headers.js index 627efdd90cc1cc..f9c654ba2f8730 100644 --- a/test/parallel/test-http-multiple-headers.js +++ b/test/parallel/test-http-multiple-headers.js @@ -64,6 +64,10 @@ const server = createServer( res.write('BODY'); res.end(); + assert.throws(() => res.appendHeader(), { + code: 'ERR_HTTP_HEADERS_SENT', + }); + assert.deepStrictEqual(res.getHeader('X-Res-a'), ['AAA', 'BBB', 'CCC']); assert.deepStrictEqual(res.getHeader('x-res-a'), ['AAA', 'BBB', 'CCC']); assert.deepStrictEqual(