Skip to content

Commit

Permalink
fix(schematics): fix affected for projects without architect config
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored and vsavkin committed Oct 4, 2018
1 parent 25b6e61 commit 0b086dd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions packages/schematics/src/command-line/shared.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,32 @@ describe('getProjectNodes', () => {
}
]);
});

it('should normalize missing architect configurations to an empty object', () => {
const result = getProjectNodes(mockAngularJson, mockNxJson).map(node => {
return { name: node.name, architect: node.architect };
});
expect(result).toEqual([
{
name: 'app1',
architect: {}
},
{
name: 'app1-e2e',
architect: {}
},
{
name: 'customName-e2e',
architect: {}
},
{
name: 'lib1',
architect: {}
},
{
name: 'lib2',
architect: {}
}
]);
});
});
2 changes: 1 addition & 1 deletion packages/schematics/src/command-line/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export function getProjectNodes(angularJson, nxJson): ProjectNode[] {
root: p.root,
type: projectType,
tags,
architect: p.architect,
architect: p.architect || {},
files: allFilesInDir(`${appRoot.path}/${p.root}`),
implicitDependencies
};
Expand Down

0 comments on commit 0b086dd

Please sign in to comment.