summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshiki Kurihara <yosyos0306@gmail.com>2022-03-15 08:28:11 +0900
committerDanielle Adams <adamzdanielle@gmail.com>2022-04-23 22:47:19 -0400
commit3d37efe5884bf42e2055ecafd41e9579cd71c57f (patch)
treee71ddf53f8e0ab341d3f36cc94453071972cded9
parent7fe16ecc7acb6e0b8beb7b1cf6098f0b96882779 (diff)
downloadnode-new-3d37efe5884bf42e2055ecafd41e9579cd71c57f.tar.gz
test: improve _http_outgoing coverage
PR-URL: https://github.com/nodejs/node/pull/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>
-rw-r--r--test/parallel/test-http-outgoing-internal-headernames-getter.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-http-outgoing-internal-headernames-getter.js b/test/parallel/test-http-outgoing-internal-headernames-getter.js
index 4a56a13010..2d8238066e 100644
--- a/test/parallel/test-http-outgoing-internal-headernames-getter.js
+++ b/test/parallel/test-http-outgoing-internal-headernames-getter.js
@@ -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');
@@ -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);
+}