File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,16 @@ fixtures.cli.forEach(function (cli) {
4545 err . should . be . null ( )
4646 }
4747
48+ // Clone the fixture we're testing against to another object because for multipart/form-data cases we're
49+ // deleting the header, and if we don't clone the fixture to another object, that deleted header will cause
50+ // other tests to fail because it's missing where other tests are expecting it.
51+ const fixture = JSON . parse ( JSON . stringify ( fixtures . requests [ request ] ) )
52+
4853 // make an exception for multipart/form-data
49- if ( fixtures . requests [ request ] . headers ) {
50- fixtures . requests [ request ] . headers . forEach ( function ( header , index ) {
54+ if ( fixture . headers ) {
55+ fixture . headers . forEach ( function ( header , index ) {
5156 if ( header . name === 'content-type' && header . value === 'multipart/form-data' ) {
52- delete fixtures . requests [ request ] . headers [ index ]
57+ delete fixture . headers [ index ]
5358 }
5459 } )
5560 }
@@ -59,7 +64,7 @@ fixtures.cli.forEach(function (cli) {
5964 har . log . entries [ 0 ] . should . have . property ( 'request' )
6065 // BUG: Mockbin returns http url even when request is for https url
6166 if ( request !== 'https' ) {
62- har . log . entries [ 0 ] . request . should . containDeep ( fixtures . requests [ request ] )
67+ har . log . entries [ 0 ] . request . should . containDeep ( fixture )
6368 }
6469 done ( )
6570 } )
You can’t perform that action at this time.
0 commit comments