@@ -5187,10 +5187,22 @@ describe.each([
51875187 instance . context . outputFileSystem . mkdirSync ( outputPath , {
51885188 recursive : true ,
51895189 } ) ;
5190+
5191+ instance . context . outputFileSystem . mkdirSync (
5192+ path . resolve ( outputPath , "slug" ) ,
5193+ {
5194+ recursive : true ,
5195+ } ,
5196+ ) ;
51905197 instance . context . outputFileSystem . writeFileSync (
51915198 path . resolve ( outputPath , "default.html" ) ,
51925199 "hello" ,
51935200 ) ;
5201+
5202+ instance . context . outputFileSystem . writeFileSync (
5203+ path . resolve ( outputPath , "slug" , "default.html" ) ,
5204+ "hello" ,
5205+ ) ;
51945206 } ) ;
51955207
51965208 afterAll ( async ( ) => {
@@ -5206,6 +5218,24 @@ describe.each([
52065218 ) ;
52075219 } ) ;
52085220
5221+ it ( 'should return the "200" code for the "GET" request to the "/slug/" path' , async ( ) => {
5222+ const response = await req . get ( "/slug/" ) ;
5223+
5224+ expect ( response . statusCode ) . toBe ( 200 ) ;
5225+ expect ( response . headers [ "content-type" ] ) . toBe (
5226+ "text/html; charset=utf-8" ,
5227+ ) ;
5228+ } ) ;
5229+
5230+ it ( 'should return the "404" code for the "GET" request to the "/slug" path' , async ( ) => {
5231+ const response = await req . get ( "/slug" ) ;
5232+
5233+ expect ( response . statusCode ) . toBe ( 404 ) ;
5234+ expect ( response . headers [ "content-type" ] ) . toEqual (
5235+ get404ContentTypeHeader ( name ) ,
5236+ ) ;
5237+ } ) ;
5238+
52095239 it ( 'should return the "404" code for the "GET" request with a non-existent file' , async ( ) => {
52105240 const response = await req . get ( "/default.html/" ) ;
52115241
0 commit comments