Skip to content

Commit

Permalink
test: increase test coverage for http.OutgoingMessage.appendHeader()
Browse files Browse the repository at this point in the history
Signed-off-by: Juan José Arboleda <[email protected]>
  • Loading branch information
juanarbol committed Oct 20, 2024
1 parent 99c6e4e commit bddf789
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/parallel/test-http-multiple-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ const server = createServer(
res.write('BODY');
res.end();

assert.throws(() => res.appendHeader(), {
code: 'ERR_HTTP_HEADERS_SENT',
name: 'Error',
message: 'Cannot append headers after they are sent to the client'
});

assert.deepStrictEqual(res.getHeader('X-Res-a'), ['AAA', 'BBB', 'CCC']);
assert.deepStrictEqual(res.getHeader('x-res-a'), ['AAA', 'BBB', 'CCC']);
assert.deepStrictEqual(
Expand Down

0 comments on commit bddf789

Please sign in to comment.