Skip to content

Commit

Permalink
test(typescript): add a test case with functions in next.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed May 23, 2022
1 parent 280e134 commit fa69054
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/integration/typescript/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,29 @@ export default function EvilPage(): JSX.Element {
expect(output.code).toBe(0)
})

it('should build the app with functions in next.config.js', async () => {
const nextConfig = new File(join(appDir, 'next.config.js'))

nextConfig.write(`
module.exports = {
webpack(config) { return config },
onDemandEntries: {
// Make sure entries are not getting disposed.
maxInactiveAge: 1000 * 60 * 60,
},
}
`)

try {
const output = await nextBuild(appDir, [], { stdout: true })

expect(output.stdout).toMatch(/Compiled successfully/)
expect(output.code).toBe(0)
} finally {
nextConfig.restore()
}
})

it('should not inform when using default tsconfig path', async () => {
const output = await nextBuild(appDir, [], { stdout: true })
expect(output.stdout).not.toMatch(/Using tsconfig file:/)
Expand Down

0 comments on commit fa69054

Please sign in to comment.