@@ -509,6 +509,17 @@ describe('Migration to v6', () => {
509
509
tree = schematicRunner . runSchematic ( 'migration-01' , defaultOptions , tree ) ;
510
510
const project = getConfig ( tree ) . projects . foo ;
511
511
expect ( project . root ) . toEqual ( '' ) ;
512
+ expect ( project . sourceRoot ) . toEqual ( 'src' ) ;
513
+ expect ( project . projectType ) . toEqual ( 'application' ) ;
514
+ } ) ;
515
+
516
+ it ( 'should set the project root values for a different root' , ( ) => {
517
+ baseConfig . apps [ 0 ] . root = 'apps/app1/src' ;
518
+ tree . create ( oldConfigPath , JSON . stringify ( baseConfig , null , 2 ) ) ;
519
+ tree = schematicRunner . runSchematic ( 'migration-01' , defaultOptions , tree ) ;
520
+ const project = getConfig ( tree ) . projects . foo ;
521
+ expect ( project . root ) . toEqual ( 'apps/app1' ) ;
522
+ expect ( project . sourceRoot ) . toEqual ( 'apps/app1/src' ) ;
512
523
expect ( project . projectType ) . toEqual ( 'application' ) ;
513
524
} ) ;
514
525
@@ -631,9 +642,26 @@ describe('Migration to v6', () => {
631
642
it ( 'should set the project root values' , ( ) => {
632
643
tree . create ( oldConfigPath , JSON . stringify ( baseConfig , null , 2 ) ) ;
633
644
tree = schematicRunner . runSchematic ( 'migration-01' , defaultOptions , tree ) ;
634
- const e2e = getConfig ( tree ) . projects [ 'foo-e2e' ] . architect . e2e ;
635
- expect ( e2e . builder ) . toEqual ( '@angular-devkit/build-angular:protractor' ) ;
636
- const options = e2e . options ;
645
+ const e2eProject = getConfig ( tree ) . projects [ 'foo-e2e' ] ;
646
+ expect ( e2eProject . root ) . toBe ( '' ) ;
647
+ expect ( e2eProject . sourceRoot ) . toBe ( 'e2e' ) ;
648
+ const e2eOptions = e2eProject . architect . e2e ;
649
+ expect ( e2eOptions . builder ) . toEqual ( '@angular-devkit/build-angular:protractor' ) ;
650
+ const options = e2eOptions . options ;
651
+ expect ( options . protractorConfig ) . toEqual ( './protractor.conf.js' ) ;
652
+ expect ( options . devServerTarget ) . toEqual ( 'foo:serve' ) ;
653
+ } ) ;
654
+
655
+ it ( 'should set the project root values for a different root' , ( ) => {
656
+ baseConfig . apps [ 0 ] . root = 'apps/app1/src' ;
657
+ tree . create ( oldConfigPath , JSON . stringify ( baseConfig , null , 2 ) ) ;
658
+ tree = schematicRunner . runSchematic ( 'migration-01' , defaultOptions , tree ) ;
659
+ const e2eProject = getConfig ( tree ) . projects [ 'foo-e2e' ] ;
660
+ expect ( e2eProject . root ) . toBe ( 'apps/app1' ) ;
661
+ expect ( e2eProject . sourceRoot ) . toBe ( 'apps/app1/e2e' ) ;
662
+ const e2eOptions = e2eProject . architect . e2e ;
663
+ expect ( e2eOptions . builder ) . toEqual ( '@angular-devkit/build-angular:protractor' ) ;
664
+ const options = e2eOptions . options ;
637
665
expect ( options . protractorConfig ) . toEqual ( './protractor.conf.js' ) ;
638
666
expect ( options . devServerTarget ) . toEqual ( 'foo:serve' ) ;
639
667
} ) ;
0 commit comments