@@ -2080,7 +2080,7 @@ describe('middleware', () => {
20802080 } ) ;
20812081 } ) ;
20822082
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' , ( ) => {
20842084 beforeAll ( ( done ) => {
20852085 const outputPath = path . resolve ( __dirname , './outputs/basic' ) ;
20862086 const compiler = getCompiler ( {
@@ -2109,10 +2109,10 @@ describe('middleware', () => {
21092109
21102110 afterAll ( close ) ;
21112111
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 ) => {
21132113 request ( app )
21142114 . 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 / )
21162116 . expect ( 200 , done ) ;
21172117 } ) ;
21182118 } ) ;
@@ -2741,15 +2741,15 @@ describe('middleware', () => {
27412741 . expect ( 200 , done ) ;
27422742 } ) ;
27432743
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 ( ) => {
27452745 app . get ( '/file.jpg' , ( req , res ) => {
27462746 res . send ( 'welcome' ) ;
27472747 } ) ;
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 ( ) ;
27532753 } ) ;
27542754 } ) ;
27552755
0 commit comments