Commit b7fe2340 authored by Kyle Holmberg's avatar Kyle Holmberg Committed by Tim Neutkens

404 routing for static export without exportPathMap (#5036)

Resolves #5035 

Thanks a billion to @timneutkens for holding my hand
parent e0c74948
......@@ -31,6 +31,12 @@ export default async function (dir, options, configuration) {
if (page === '/_document' || page === '/_app') {
continue
}
if (page === '/_error') {
defaultPathMap['404'] = { page }
continue
}
defaultPathMap[page] = { page }
}
......
......@@ -48,5 +48,10 @@ export default function (context) {
const $ = cheerio.load(html)
expect($('img').attr('src')).toBe('/static/myimage.png')
})
it('should render _error on 404', async () => {
const html = await renderViaHTTP(context.port, '/404')
expect(html).toMatch(/404/)
})
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment