Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: merge export-404-html & export-override-404
  • Loading branch information
SukkaW committed May 14, 2022
commit de95c826e3541ed9a72685e7c514dd03b008f9ab
1 change: 0 additions & 1 deletion test/integration/export-404-html/pages/index.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/* eslint-env jest */

import { promises } from 'fs'
import { join } from 'path'
import { nextBuild, nextExport, File } from 'next-test-utils'

import { promises } from 'fs'

const { access, stat } = promises
const { readFile, access, stat } = promises
const appDir = join(__dirname, '../')
const outdir = join(appDir, 'out')
const context = {}
context.appDir = appDir

const nextConfig = new File(join(appDir, 'next.config.js'))

const fileExist = (path) =>
Expand Down Expand Up @@ -41,3 +39,13 @@ describe('Static 404 Export', () => {
expect(await fileExist(join(outdir, '404.html'))).toBe(true)
})
})

describe('Export with a page named 404.js', () => {
it('should export a custom 404.html instead of default 404.html', async () => {
await nextBuild(appDir)
await nextExport(appDir, { outdir })

const html = await readFile(join(outdir, '404.html'), 'utf8')
expect(html).toMatch(/this is a 404 page override the default 404\.html/)
})
})
21 changes: 0 additions & 21 deletions test/integration/export-override-404/test/index.test.js

This file was deleted.