@@ -31,7 +31,7 @@ test('express res/req serialization', t => {
3131 const app = express ( )
3232 let server
3333
34- app . get ( '/' , ( req , res ) => {
34+ app . get ( '/apath ' , ( req , res ) => {
3535 const rec = { }
3636
3737 res . setHeader ( 'Foo' , 'Bar' )
@@ -45,17 +45,20 @@ test('express res/req serialization', t => {
4545
4646 t . same ( rec . user_agent , { original : 'cool-agent' } )
4747 t . same ( rec . url , {
48- path : '/' ,
49- full : `http://127.0.0.1:${ server . address ( ) . port } /` ,
48+ full : `http://127.0.0.1:${ server . address ( ) . port } /apath?aquery` ,
49+ path : '/apath' ,
50+ query : 'aquery' ,
5051 domain : '127.0.0.1'
5152 } )
5253 t . same ( rec . http , {
5354 version : '1.1' ,
5455 request : {
56+ id : 'arequestid' ,
5557 method : 'GET' ,
5658 headers : {
5759 'user-agent' : 'cool-agent' ,
5860 host : `127.0.0.1:${ server . address ( ) . port } ` ,
61+ 'x-request-id' : 'arequestid' ,
5962 connection : 'close'
6063 }
6164 } ,
@@ -78,9 +81,13 @@ test('express res/req serialization', t => {
7881 app . listen ( 0 , '127.0.0.1' , function ( ) {
7982 server = this
8083 const req = http . get (
81- `http://127.0.0.1:${ server . address ( ) . port } /` ,
84+ `http://127.0.0.1:${ server . address ( ) . port } /apath?aquery#ahash ` ,
8285 {
83- headers : { 'user-agent' : 'cool-agent' , connection : 'close' }
86+ headers : {
87+ 'user-agent' : 'cool-agent' ,
88+ connection : 'close' ,
89+ 'x-request-id' : 'arequestid'
90+ }
8491 } ,
8592 function ( res ) {
8693 res . on ( 'data' , function ( ) { } )
@@ -91,6 +98,6 @@ test('express res/req serialization', t => {
9198 } )
9299 }
93100 )
94- req . on ( 'error' , t . ifErr )
101+ req . on ( 'error' , t . error )
95102 } )
96103} )
0 commit comments