Skip to content

Commit

Permalink
fix(testing): fix generating cypress-project with no project specified
Browse files Browse the repository at this point in the history
  • Loading branch information
devinshoemaker committed May 30, 2020
1 parent 606ad29 commit 3263174
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Expand Up @@ -221,5 +221,20 @@ describe('schematic:cypress-project', () => {
);
});
});

describe('--project', () => {
describe('none', () => {
it('should not add any implicit dependencies', async () => {
const tree = await runSchematic(
'cypress-project',
{ name: 'my-app-e2e' },
appTree
);

const nxJson = readJsonInTree(tree, 'nx.json');
expect(nxJson.projects['my-app-e2e']).toEqual({ tags: [] });
});
});
});
});
});
Expand Up @@ -51,8 +51,14 @@ function updateNxJson(options: CypressProjectSchema): Rule {
return updateJsonInTree<NxJson>('nx.json', (json) => {
json.projects[options.projectName] = {
tags: [],
implicitDependencies: [options.project],
};

if (options.project) {
json.projects[options.projectName].implicitDependencies = [
options.project,
];
}

return json;
});
}
Expand Down

0 comments on commit 3263174

Please sign in to comment.