File tree 2 files changed +11
-7
lines changed
2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,17 @@ function routes(server) {
28
28
createReadStream ( join ( clientBasePath , 'index.bundle.js' ) ) . pipe ( res ) ;
29
29
} ) ;
30
30
31
+ app . get ( '/webpack-dev-server/invalidate' , ( _req , res ) => {
32
+ server . invalidate ( ) ;
33
+ res . end ( ) ;
34
+ } ) ;
35
+
31
36
app . get ( '/webpack-dev-server/*' , ( req , res ) => {
32
37
res . setHeader ( 'Content-Type' , 'text/html' ) ;
33
38
34
39
createReadStream ( join ( clientBasePath , 'live.html' ) ) . pipe ( res ) ;
35
40
} ) ;
36
41
37
- app . get ( '/invalidate' , ( _req , res ) => {
38
- server . invalidate ( ) ;
39
- res . end ( ) ;
40
- } ) ;
41
-
42
42
app . get ( '/webpack-dev-server' , ( req , res ) => {
43
43
res . setHeader ( 'Content-Type' , 'text/html' ) ;
44
44
Original file line number Diff line number Diff line change @@ -64,8 +64,12 @@ describe('routes util', () => {
64
64
} ) ;
65
65
} ) ;
66
66
67
- it ( 'GET request to invalidate endpoint' , ( done ) => {
68
- req . get ( '/invalidate' ) . expect ( 200 , done ) ;
67
+ it ( 'should handles GET request to invalidate endpoint' , ( done ) => {
68
+ req . get ( '/webpack-dev-server/invalidate' ) . then ( ( { res } ) => {
69
+ expect ( res . headers [ 'content-type' ] ) . not . toEqual ( 'text/html' ) ;
70
+ expect ( res . statusCode ) . toEqual ( 200 ) ;
71
+ done ( ) ;
72
+ } ) ;
69
73
} ) ;
70
74
71
75
it ( 'should handles GET request to live html' , ( done ) => {
You can’t perform that action at this time.
0 commit comments