test: improve coverage of lib/_http_outgoing.js

Refs: https://coverage.nodejs.org/coverage-36bb31be5f0b85a0/lib/_http_outgoing.js.html#L351
Refs: https://coverage.nodejs.org/coverage-36bb31be5f0b85a0/lib/_http_outgoing.js.html#L609

PR-URL: https://github.com/nodejs/node/pull/38734
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rongjian Zhang authored and Danielle Adams committed 2021-05-31 15:34:50 -04:00
1 parent 7fb809b475
commit 11ac9c6fcc
2 files changed
+3 -2

No files matched your search

@@ -1,5 +1,5 @@
'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const http = require('http');
const Countdown = require('../common/countdown');
@@ -13,7 +13,7 @@ const server = http.createServer((req, res) => {
// to call res.writeHead instead
res._writeRaw('HTTP/1.1 102 Processing\r\n');
res._writeRaw('Foo: Bar\r\n');
res._writeRaw('\r\n');
res._writeRaw('\r\n', common.mustCall());
console.error('Server sending full response...');
res.writeHead(200, {
'Content-Type': 'text/plain',
@@ -47,6 +47,7 @@ const s = http.createServer(common.mustCall((req, res) => {
const exoticObj = Object.create(null);
assert.deepStrictEqual(headers, exoticObj);
assert.deepStrictEqual(res.getHeaderNames(), []);
assert.deepStrictEqual(res.getRawHeaderNames(), []);
assert.deepStrictEqual(res.hasHeader('Connection'), false);
assert.deepStrictEqual(res.getHeader('Connection'), undefined);