Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions test/parallel/test-http-outgoing-internal-headers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Flags: --expose-internals
'use strict';
const common = require('../common');
const assert = require('assert');

const { outHeadersKey } = require('internal/http');
const { OutgoingMessage } = require('http');

{
// tests for _headers get method
const outgoingMessage = new OutgoingMessage();
outgoingMessage.getHeaders = common.mustCall();
outgoingMessage._headers;
}

{
// tests for _headers set method
const outgoingMessage = new OutgoingMessage();
outgoingMessage._headers = {
host: 'risingstack.com',
Origin: 'localhost'
};

assert.deepStrictEqual(outgoingMessage[outHeadersKey], {
host: ['host', 'risingstack.com'],
origin: ['Origin', 'localhost']
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint: file needs to end with \n