@@ -120,6 +120,7 @@ const DEFAULT_CONFIG = {
120
120
'/products' : '/generic-product' ,
121
121
'/articles/' : '/special/default-article' ,
122
122
'/app' : '/spa/index.html' ,
123
+ '/broken' : '/not-a-page' ,
123
124
} ,
124
125
headers : HEADERS ,
125
126
metadata : {
@@ -527,6 +528,18 @@ describe('Rendering', () => {
527
528
assert . strictEqual ( body . trim ( ) , '' ) ;
528
529
} ) ;
529
530
531
+ it ( 'renders 404 for folder mapped not found' , async ( ) => {
532
+ const { headers, body } = await testRender ( new URL ( 'https://helix-pipeline.com/broken/folder' ) , 'html' , 404 ) ;
533
+ assert . deepStrictEqual ( Object . fromEntries ( headers . entries ( ) ) , {
534
+ 'access-control-allow-origin' : '*' ,
535
+ 'content-type' : 'text/html; charset=utf-8' ,
536
+ link : '</scripts/scripts.js>; rel=modulepreload; as=script; crossorigin=use-credentials' ,
537
+ 'x-error' : 'failed to load /not-a-page.md from content-bus: 404' ,
538
+ 'x-surrogate-key' : 'gPHXKWdMY_R8KV2Z foo-id super-test--helix-pages--adobe_404 super-test--helix-pages--adobe_code QJqsV4atnOA47sHc' ,
539
+ } ) ;
540
+ assert . strictEqual ( body . trim ( ) , '' ) ;
541
+ } ) ;
542
+
530
543
it ( 'renders 301 for redirect file' , async ( ) => {
531
544
loader . headers ( 'one-section.md' , 'x-amz-meta-redirect-location' , 'https://www.adobe.com' ) ;
532
545
const ret = await render ( new URL ( 'https://localhost/one-section' ) , '' , 301 ) ;
0 commit comments