Skip to content

Commit

Permalink
test: improve _http_outgoing coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kuriyosh committed Mar 4, 2022
1 parent 29bb2bb commit 887d0b6
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
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 887d0b6

Please sign in to comment.