From fa690541a8ffdc08ce2e0ebbb29f33027f1c4c72 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Mon, 23 May 2022 23:00:17 +0800 Subject: [PATCH] test(typescript): add a test case with functions in next.config.js --- .../integration/typescript/test/index.test.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/integration/typescript/test/index.test.js b/test/integration/typescript/test/index.test.js index 46abf9f64059f..c9ba200286d81 100644 --- a/test/integration/typescript/test/index.test.js +++ b/test/integration/typescript/test/index.test.js @@ -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:/)