From 11ac9c6fcc98bebf5990f568342da2865bd7b7ee Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Wed, 19 May 2021 17:27:44 +0800 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Zijian Liu Reviewed-By: James M Snell --- test/parallel/test-http-information-headers.js | 4 ++-- test/parallel/test-http-mutable-headers.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-http-information-headers.js b/test/parallel/test-http-information-headers.js index f5cfa5078b85ac..fc860b321f03e9 100644 --- a/test/parallel/test-http-information-headers.js +++ b/test/parallel/test-http-information-headers.js @@ -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', diff --git a/test/parallel/test-http-mutable-headers.js b/test/parallel/test-http-mutable-headers.js index 46f57832af156d..2210750e6c359b 100644 --- a/test/parallel/test-http-mutable-headers.js +++ b/test/parallel/test-http-mutable-headers.js @@ -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);