Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Mar 21, 2023
1 parent 43ab720 commit 1d325d4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/e2e/app-dir/not-found/not-found.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ createNextDescribe(
files: __dirname,
skipDeployment: true,
},
({ next }) => {
({ next, isNextDev }) => {
describe('root not-found page', () => {
it('should use the not-found page for non-matching routes', async () => {
const html = await next.render('/random-content')
expect(html).toContain('This Is The Not Found Page')
})

it('should create the 404 mapping and copy the file to pages', async () => {
const html = await next.readFile('.next/server/pages/404.html')
expect(html).toContain('This Is The Not Found Page')
expect(
await next.readFile('.next/server/pages-manifest.json')
).toContain('"pages/404.html"')
})
if (!isNextDev) {
it('should create the 404 mapping and copy the file to pages', async () => {
const html = await next.readFile('.next/server/pages/404.html')
expect(html).toContain('This Is The Not Found Page')
expect(
await next.readFile('.next/server/pages-manifest.json')
).toContain('"pages/404.html"')
})
}
})
}
)

0 comments on commit 1d325d4

Please sign in to comment.