Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4941791

Browse filesBrowse files
kuriyoshbengl
authored andcommitted
test: improve _http_outgoing coverage
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>
1 parent 21198c1 commit 4941791
Copy full SHA for 4941791

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-http-outgoing-internal-headernames-getter.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-outgoing-internal-headernames-getter.js
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
const common = require('../common');
33

44
const { OutgoingMessage } = require('http');
5+
const assert = require('assert');
56

67
const warn = 'OutgoingMessage.prototype._headerNames is deprecated';
78
common.expectWarning('DeprecationWarning', warn, 'DEP0066');
@@ -11,3 +12,12 @@ common.expectWarning('DeprecationWarning', warn, 'DEP0066');
1112
const outgoingMessage = new OutgoingMessage();
1213
outgoingMessage._headerNames; // eslint-disable-line no-unused-expressions
1314
}
15+
16+
{
17+
// Tests _headerNames getter result after setting a header.
18+
const outgoingMessage = new OutgoingMessage();
19+
outgoingMessage.setHeader('key', 'value');
20+
const expect = Object.create(null);
21+
expect.key = 'key';
22+
assert.deepStrictEqual(outgoingMessage._headerNames, expect);
23+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.