Skip to content

Commit 0b086dd

Browse files
FrozenPandazvsavkin
authored andcommittedOct 4, 2018
fix(schematics): fix affected for projects without architect config
1 parent 25b6e61 commit 0b086dd

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed
 

‎packages/schematics/src/command-line/shared.spec.ts

+28
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,32 @@ describe('getProjectNodes', () => {
363363
}
364364
]);
365365
});
366+
367+
it('should normalize missing architect configurations to an empty object', () => {
368+
const result = getProjectNodes(mockAngularJson, mockNxJson).map(node => {
369+
return { name: node.name, architect: node.architect };
370+
});
371+
expect(result).toEqual([
372+
{
373+
name: 'app1',
374+
architect: {}
375+
},
376+
{
377+
name: 'app1-e2e',
378+
architect: {}
379+
},
380+
{
381+
name: 'customName-e2e',
382+
architect: {}
383+
},
384+
{
385+
name: 'lib1',
386+
architect: {}
387+
},
388+
{
389+
name: 'lib2',
390+
architect: {}
391+
}
392+
]);
393+
});
366394
});

‎packages/schematics/src/command-line/shared.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export function getProjectNodes(angularJson, nxJson): ProjectNode[] {
296296
root: p.root,
297297
type: projectType,
298298
tags,
299-
architect: p.architect,
299+
architect: p.architect || {},
300300
files: allFilesInDir(`${appRoot.path}/${p.root}`),
301301
implicitDependencies
302302
};

0 commit comments

Comments
 (0)
Please sign in to comment.