Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve _http_outgoing coverage #42213

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}