@@ -2080,7 +2080,7 @@ describe('middleware', () => {
2080
2080
} ) ;
2081
2081
} ) ;
2082
2082
2083
- describe ( 'should set "Content-Type" header for route not from outputFileSystem' , ( ) => {
2083
+ describe ( 'should not set "Content-Type" header for route not from outputFileSystem' , ( ) => {
2084
2084
beforeAll ( ( done ) => {
2085
2085
const outputPath = path . resolve ( __dirname , './outputs/basic' ) ;
2086
2086
const compiler = getCompiler ( {
@@ -2109,10 +2109,10 @@ describe('middleware', () => {
2109
2109
2110
2110
afterAll ( close ) ;
2111
2111
2112
- it ( 'should return the "200" code for the "GET" request "file.jpg"' , ( done ) => {
2112
+ it ( 'should return the "200" code for the "GET" request "file.jpg" with default content type ' , ( done ) => {
2113
2113
request ( app )
2114
2114
. get ( '/file.jpg' )
2115
- . expect ( 'Content-Type' , / a p p l i c a t i o n \/ o c t e t - s t r e a m / )
2115
+ . expect ( 'Content-Type' , / t e x t \/ h t m l / )
2116
2116
. expect ( 200 , done ) ;
2117
2117
} ) ;
2118
2118
} ) ;
@@ -2741,15 +2741,15 @@ describe('middleware', () => {
2741
2741
. expect ( 200 , done ) ;
2742
2742
} ) ;
2743
2743
2744
- it ( 'should return the "200" code for the "GET" request to path not in outputFileSystem and return headers' , ( done ) => {
2744
+ it ( 'should return the "200" code for the "GET" request to path not in outputFileSystem but not return headers' , async ( ) => {
2745
2745
app . get ( '/file.jpg' , ( req , res ) => {
2746
2746
res . send ( 'welcome' ) ;
2747
2747
} ) ;
2748
- request ( app )
2749
- . get ( '/file.jpg' )
2750
- . expect ( 'X-nonsense-1' , 'yes' )
2751
- . expect ( 'X-nonsense-2' , 'no' )
2752
- . expect ( 200 , done ) ;
2748
+
2749
+ const res = await request ( app ) . get ( '/file.jpg' ) ;
2750
+ expect ( res . statusCode ) . toEqual ( 200 ) ;
2751
+ expect ( res . headers [ 'X-nonsense-1' ] ) . toBeUndefined ( ) ;
2752
+ expect ( res . headers [ 'X-nonsense-2' ] ) . toBeUndefined ( ) ;
2753
2753
} ) ;
2754
2754
} ) ;
2755
2755
0 commit comments