Skip to content

Commit

Permalink
fix(nextjs): do not generate test for appDir page.tsx (#16509)
Browse files Browse the repository at this point in the history
  • Loading branch information
barbados-clemens committed Apr 24, 2023
1 parent a2b1176 commit 808b4d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/next/src/generators/application/application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { join } from 'path';
import {
generateFiles,
joinPathFragments,
names,
readJson,
toJS,
Expand Down Expand Up @@ -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,
Expand Down

1 comment on commit 808b4d1

@vercel
Copy link

@vercel vercel bot commented on 808b4d1 Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app

Please sign in to comment.