chore(nextjs): add a e2e test for next.js without nx config entry (#11913)

This commit is contained in:
Jack Hsu 2022-09-07 09:12:35 -04:00 committed by GitHub
parent 2c407791be
commit 84c2330311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
import {
rmDist,
checkFilesExist,
cleanupProject,
expectJestTestsToPass,
@ -263,6 +264,22 @@ describe('Next.js Applications', () => {
checkFilesExist(`dist/apps/${appName}/next.config.js`);
expect(result).toContain('NODE_ENV is production');
updateFile(
`apps/${appName}/next.config.js`,
`
const { withNx } = require('@nrwl/next/plugins/with-nx');
// Not including "nx" entry should still work.
const nextConfig = {};
module.exports = withNx(nextConfig);
`
);
rmDist();
runCLI(`build ${appName}`);
checkFilesExist(`dist/apps/${appName}/next.config.js`);
}, 300_000);
it('should support --js flag', async () => {