mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
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>
This commit is contained in:
1 parent
7fe16ecc7a
commit
3d37efe588
1 file changed
+10
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user