Skip to content

Commit

Permalink
test: improve _http_outgoing coverage
Browse files Browse the repository at this point in the history
PR-URL: #42213
Refs: https://coverage.nodejs.org/coverage-29bb2bb57d2a993e/lib/_http_outgoing.js.html
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
kuriyosh authored and danielleadams committed Apr 24, 2022
1 parent 030a8b8 commit 4dfbc66
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/parallel/test-http-outgoing-internal-headernames-getter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const common = require('../common');

const { OutgoingMessage } = require('http');
const assert = require('assert');

const warn = 'OutgoingMessage.prototype._headerNames is deprecated';
common.expectWarning('DeprecationWarning', warn, 'DEP0066');
Expand All @@ -11,3 +12,12 @@ common.expectWarning('DeprecationWarning', warn, 'DEP0066');
const outgoingMessage = new OutgoingMessage();
outgoingMessage._headerNames; // eslint-disable-line no-unused-expressions
}

{
// Tests _headerNames getter result after setting a header.
const outgoingMessage = new OutgoingMessage();
outgoingMessage.setHeader('key', 'value');
const expect = Object.create(null);
expect.key = 'key';
assert.deepStrictEqual(outgoingMessage._headerNames, expect);
}

0 comments on commit 4dfbc66

Please sign in to comment.