Skip to content

Commit

Permalink
cleanup(core): add e2e tests for new implicit dependencies definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Nov 14, 2022
1 parent fe23175 commit b9ed938
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions e2e/nx-run/src/affected-graph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,21 @@ describe('Nx Affected and Graph Tests', () => {
expect(runCLI('affected:apps')).toContain(myapp2);
expect(runCLI('affected:libs')).not.toContain(mylib);
});

it('should detect changes to implicitly dependant projects', () => {
generateAll();
updateProjectConfig(myapp, (config) => ({
...config,
implicitDependencies: ['*', `!${myapp2}`],
}));

const affectedApps = runCLI('affected:apps');
const affectedLibs = runCLI('affected:libs');

expect(affectedApps).toContain(myapp);
expect(affectedApps).not.toContain(myapp2);
expect(affectedLibs).toContain(mylib);
});
});

describe('print-affected', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/utils/assert-workspace-validity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function detectAndSetInvalidProjectValues(
const projectName = implicit.startsWith('!')
? implicit.substring(1)
: implicit;
return !validProjects[projectName];
return !(implicit === '*' || validProjects[projectName]);
});

if (invalidProjects.length > 0) {
Expand Down

0 comments on commit b9ed938

Please sign in to comment.