fix(nextjs): Add exclude to root projects e2e tsconfig so that tests will be picked up. (#16459)
This commit is contained in:
parent
258cda37ec
commit
a908ef586a
@ -17,6 +17,7 @@ import { nextInitGenerator } from '../init/init';
|
|||||||
import { addStyleDependencies } from '../../utils/styles';
|
import { addStyleDependencies } from '../../utils/styles';
|
||||||
import { addLinting } from './lib/add-linting';
|
import { addLinting } from './lib/add-linting';
|
||||||
import { customServerGenerator } from '../custom-server/custom-server';
|
import { customServerGenerator } from '../custom-server/custom-server';
|
||||||
|
import { updateCypressTsConfig } from './lib/update-cypress-tsconfig';
|
||||||
|
|
||||||
export async function applicationGenerator(host: Tree, schema: Schema) {
|
export async function applicationGenerator(host: Tree, schema: Schema) {
|
||||||
const options = normalizeOptions(host, schema);
|
const options = normalizeOptions(host, schema);
|
||||||
@ -31,6 +32,7 @@ export async function applicationGenerator(host: Tree, schema: Schema) {
|
|||||||
const jestTask = await addJest(host, options);
|
const jestTask = await addJest(host, options);
|
||||||
const lintTask = await addLinting(host, options);
|
const lintTask = await addLinting(host, options);
|
||||||
updateJestConfig(host, options);
|
updateJestConfig(host, options);
|
||||||
|
updateCypressTsConfig(host, options);
|
||||||
const styledTask = addStyleDependencies(host, options.style);
|
const styledTask = addStyleDependencies(host, options.style);
|
||||||
setDefaults(host, options);
|
setDefaults(host, options);
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
import { Tree, updateJson } from '@nx/devkit';
|
||||||
|
import { NormalizedSchema } from './normalize-options';
|
||||||
|
|
||||||
|
export function updateCypressTsConfig(host: Tree, options: NormalizedSchema) {
|
||||||
|
if (options.e2eTestRunner !== 'cypress' || !options.rootProject) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateJson(
|
||||||
|
host,
|
||||||
|
`${options.e2eProjectRoot}/${options.e2eProjectName}/tsconfig.json`,
|
||||||
|
(json) => {
|
||||||
|
return {
|
||||||
|
...json,
|
||||||
|
exclude: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user