diff --git a/packages/next/src/generators/application/application.spec.ts b/packages/next/src/generators/application/application.spec.ts index 43e2410cd77e5..96c54fdee488b 100644 --- a/packages/next/src/generators/application/application.spec.ts +++ b/packages/next/src/generators/application/application.spec.ts @@ -452,12 +452,12 @@ describe('app', () => { expect(tree.exists('apps/testApp/pages/styles.css')).toBeFalsy(); - expect(tree.exists('apps/testApp/app/global.css')); - expect(tree.exists('apps/testApp/app/page.tsx')); - expect(tree.exists('apps/testApp/app/layout.tsx')); - expect(tree.exists('apps/testApp/app/api/hello/route.ts')); - expect(tree.exists('apps/testApp/app/page.module.css')); - expect(tree.exists('apps/testApp/app/favicon.ico')); + expect(tree.exists('apps/test-app/app/global.css')).toBeTruthy(); + expect(tree.exists('apps/test-app/app/page.tsx')).toBeTruthy(); + expect(tree.exists('apps/test-app/app/layout.tsx')).toBeTruthy(); + expect(tree.exists('apps/test-app/app/api/hello/route.ts')).toBeTruthy(); + expect(tree.exists('apps/test-app/app/page.module.css')).toBeTruthy(); + expect(tree.exists('apps/test-app/public/favicon.ico')).toBeTruthy(); }); }); }); diff --git a/packages/next/src/generators/application/lib/create-application-files.ts b/packages/next/src/generators/application/lib/create-application-files.ts index ae9fe71e7e141..a1e4290a73b89 100644 --- a/packages/next/src/generators/application/lib/create-application-files.ts +++ b/packages/next/src/generators/application/lib/create-application-files.ts @@ -1,6 +1,7 @@ import { join } from 'path'; import { generateFiles, + joinPathFragments, names, readJson, toJS, @@ -48,6 +49,13 @@ export function createApplicationFiles(host: Tree, options: NormalizedSchema) { join(options.appProjectRoot, 'app'), templateVariables ); + host.delete( + joinPathFragments( + options.appProjectRoot, + 'specs', + `index.spec.${options.js ? 'jsx' : 'tsx'}` + ) + ); } else { generateFiles( host,