Skip to content

Commit

Permalink
add static 404 with react 18 test
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Mar 30, 2022
1 parent 5bf5da7 commit 858358d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/production/react-18-streaming-ssr/index.test.ts
Expand Up @@ -38,6 +38,14 @@ describe('react 18 streaming SSR in minimal mode', () => {
const html = await renderViaHTTP(next.url, '/')
expect(html).toContain('static streaming')
})

it('should have generated a static 404 page', async () => {
expect(await next.readFile('.next/server/pages/404.html')).toBeTruthy()

const res = await fetchViaHTTP(next.url, '/non-existent')
expect(res.status).toBe(404)
expect(await res.text()).toContain('This page could not be found')
})
})

describe('react 18 streaming SSR with custom next configs', () => {
Expand Down

0 comments on commit 858358d

Please sign in to comment.