Skip to content

Commit

Permalink
test: merge export-404-html & export-override-404
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed May 14, 2022
1 parent 08214a9 commit de95c82
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
1 change: 0 additions & 1 deletion test/integration/export-404-html/pages/index.js

This file was deleted.

File renamed without changes.
File renamed without changes.
@@ -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.

0 comments on commit de95c82

Please sign in to comment.