@@ -51,6 +51,14 @@ describe('Server', () => {
5151 listen = listenShorthand ( done ) ;
5252 // Hack to add a mock HMR json file to the in-memory filesystem.
5353 instance . fileSystem . writeFileSync ( '/123a123412.hot-update.json' , '["hi"]' ) ;
54+
55+ // Add a nested directory and index.html inside
56+ instance . fileSystem . mkdirSync ( '/reference' ) ;
57+ instance . fileSystem . mkdirSync ( '/reference/mono-v6.x.x' ) ;
58+ instance . fileSystem . writeFileSync (
59+ '/reference/mono-v6.x.x/index.html' ,
60+ 'My Index.'
61+ ) ;
5462 } ) ;
5563
5664 after ( close ) ;
@@ -103,6 +111,14 @@ describe('Server', () => {
103111 . expect ( 200 , / M y I n d e x \. / , done ) ;
104112 } ) ;
105113
114+ it ( 'request to subdirectory without trailing slash' , ( done ) => {
115+ request ( app )
116+ . get ( '/public/reference/mono-v6.x.x' )
117+ . expect ( 'Content-Type' , 'text/html; charset=UTF-8' )
118+ . expect ( 'Content-Length' , '9' )
119+ . expect ( 200 , / M y I n d e x \. / , done ) ;
120+ } ) ;
121+
106122 it ( 'invalid range header' , ( done ) => {
107123 request ( app ) . get ( '/public/svg.svg' )
108124 . set ( 'Range' , 'bytes=6000-' )
0 commit comments