File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5191,6 +5191,11 @@ describe.each([
51915191 path . resolve ( outputPath , "default.html" ) ,
51925192 "hello" ,
51935193 ) ;
5194+
5195+ instance . context . outputFileSystem . writeFileSync (
5196+ path . resolve ( outputPath , "slug" , "default.html" ) ,
5197+ "hello" ,
5198+ ) ;
51945199 } ) ;
51955200
51965201 afterAll ( async ( ) => {
@@ -5206,6 +5211,24 @@ describe.each([
52065211 ) ;
52075212 } ) ;
52085213
5214+ it ( 'should return the "200" code for the "GET" request to the "/slug/" path' , async ( ) => {
5215+ const response = await req . get ( "/slug/" ) ;
5216+
5217+ expect ( response . statusCode ) . toBe ( 200 ) ;
5218+ expect ( response . headers [ "content-type" ] ) . toBe (
5219+ "text/html; charset=utf-8" ,
5220+ ) ;
5221+ } ) ;
5222+
5223+ it ( 'should return the "404" code for the "GET" request to the "/slug" path' , async ( ) => {
5224+ const response = await req . get ( "/slug" ) ;
5225+
5226+ expect ( response . statusCode ) . toBe ( 404 ) ;
5227+ expect ( response . headers [ "content-type" ] ) . toEqual (
5228+ get404ContentTypeHeader ( name ) ,
5229+ ) ;
5230+ } ) ;
5231+
52095232 it ( 'should return the "404" code for the "GET" request with a non-existent file' , async ( ) => {
52105233 const response = await req . get ( "/default.html/" ) ;
52115234
You can’t perform that action at this time.
0 commit comments