11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ciconst { OutgoingMessage } = require('http'); 51cb0ef41Sopenharmony_ciconst assert = require('assert'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst warn = 'OutgoingMessage.prototype._headerNames is deprecated'; 81cb0ef41Sopenharmony_cicommon.expectWarning('DeprecationWarning', warn, 'DEP0066'); 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ci{ 111cb0ef41Sopenharmony_ci // Tests for _headerNames get method 121cb0ef41Sopenharmony_ci const outgoingMessage = new OutgoingMessage(); 131cb0ef41Sopenharmony_ci outgoingMessage._headerNames; // eslint-disable-line no-unused-expressions 141cb0ef41Sopenharmony_ci} 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci{ 171cb0ef41Sopenharmony_ci // Tests _headerNames getter result after setting a header. 181cb0ef41Sopenharmony_ci const outgoingMessage = new OutgoingMessage(); 191cb0ef41Sopenharmony_ci outgoingMessage.setHeader('key', 'value'); 201cb0ef41Sopenharmony_ci const expect = Object.create(null); 211cb0ef41Sopenharmony_ci expect.key = 'key'; 221cb0ef41Sopenharmony_ci assert.deepStrictEqual(outgoingMessage._headerNames, expect); 231cb0ef41Sopenharmony_ci} 24