Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Commit 704ea41

Browse files
konstantindenerzanthonymjones
authored andcommitted
feat(schematics): insert project specific path in *.lint.tsConfig instead of cypress/tsconfig.js if project.root is available
1 parent 1cd4e2f commit 704ea41

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/schematics/cypress/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,15 @@ function modifyAngularJson(options: any): Rule {
265265
};
266266
}
267267

268-
export const addCypressTsConfig = (tree: Tree, angularJsonVal: any, project: string) => {
269-
const tsConfig = angularJsonVal.projects[project]?.architect?.lint?.options?.tsConfig;
268+
export const addCypressTsConfig = (tree: Tree, angularJsonVal: any, projectName: string) => {
269+
const project = angularJsonVal.projects[projectName];
270+
const tsConfig = project?.architect?.lint?.options?.tsConfig;
270271
if (tsConfig) {
271-
tsConfig.push('cypress/tsconfig.json');
272+
let prefix = '';
273+
if (project.root) {
274+
prefix = `${project.root}/`;
275+
}
276+
tsConfig.push(`${prefix}cypress/tsconfig.json`);
272277
}
273278
return tree.overwrite('./angular.json', JSON.stringify(angularJsonVal, null, 2));
274279
};

0 commit comments

Comments
 (0)