Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nextjs): Library generator should not add cypress dependency #19587

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions packages/next/src/generators/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,26 @@ describe('next library', () => {
'@proj/my-lib/server': ['my-lib/src/server.ts'],
});
});

it('should not add cypress dependencies', async () => {
const appTree = createTreeWithEmptyWorkspace();

await libraryGenerator(appTree, {
name: 'myLib',
linter: Linter.EsLint,
skipFormat: false,
skipTsConfig: false,
unitTestRunner: 'jest',
style: 'css',
component: false,
projectNameAndRootFormat: 'as-provided',
});

expect(
readJson(appTree, 'package.json').devDependencies['@nx/cypress']
).toBeUndefined();
expect(
readJson(appTree, 'package.json').devDependencies['cypress']
).toBeUndefined();
});
});
1 change: 1 addition & 0 deletions packages/next/src/generators/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export async function libraryGeneratorInternal(host: Tree, rawOptions: Schema) {
const tasks: GeneratorCallback[] = [];
const initTask = await nextInitGenerator(host, {
...options,
e2eTestRunner: 'none',
skipFormat: true,
});
tasks.push(initTask);
Expand Down