File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ // Flags: --expose-internals
2+ 'use strict' ;
3+ const common = require ( '../common' ) ;
4+ const assert = require ( 'assert' ) ;
5+
6+ const { outHeadersKey } = require ( 'internal/http' ) ;
7+ const { OutgoingMessage } = require ( 'http' ) ;
8+
9+ {
10+ // tests for _headers get method
11+ const outgoingMessage = new OutgoingMessage ( ) ;
12+ outgoingMessage . getHeaders = common . mustCall ( ) ;
13+ outgoingMessage . _headers ;
14+ }
15+
16+ {
17+ // tests for _headers set method
18+ const outgoingMessage = new OutgoingMessage ( ) ;
19+ outgoingMessage . _headers = {
20+ host : 'risingstack.com' ,
21+ Origin : 'localhost'
22+ } ;
23+
24+ assert . deepStrictEqual ( outgoingMessage [ outHeadersKey ] , {
25+ host : [ 'host' , 'risingstack.com' ] ,
26+ origin : [ 'Origin' , 'localhost' ]
27+ } ) ;
28+ }
You can’t perform that action at this time.
0 commit comments