@@ -2,6 +2,7 @@ import * as path from 'path';
2
2
3
3
import { EmptyTree } from '@angular-devkit/schematics' ;
4
4
import { SchematicTestRunner , UnitTestTree } from '@angular-devkit/schematics/testing' ;
5
+ import { ProjectType } from '../../schematics/utils/util' ;
5
6
6
7
const version = '15.0.4' ;
7
8
@@ -24,18 +25,44 @@ describe(`Update to ${version}`, () => {
24
25
} ,
25
26
version : 1
26
27
} ;
28
+ const configJsonLib = {
29
+ defaultProject : 'testProj' ,
30
+ projects : {
31
+ testProj : {
32
+ root : '/' ,
33
+ sourceRoot : '/testSrc' ,
34
+ prefix : 'lib' ,
35
+ projectType : ProjectType . Library ,
36
+ architect : {
37
+ build : {
38
+ options : {
39
+ }
40
+ }
41
+ }
42
+ }
43
+ } ,
44
+ version : 1
45
+ } ;
27
46
28
47
beforeEach ( ( ) => {
29
48
appTree = new UnitTestTree ( new EmptyTree ( ) ) ;
30
- appTree . create ( '/angular.json' , JSON . stringify ( configJson ) ) ;
31
49
} ) ;
32
50
33
51
const migrationName = 'migration-27' ;
34
52
35
53
it ( `should add igniteui-theming to pacakage json and configure it` , async ( ) => {
54
+ appTree . create ( '/angular.json' , JSON . stringify ( configJson ) ) ;
36
55
const tree = await schematicRunner . runSchematicAsync ( migrationName , { } , appTree )
37
56
. toPromise ( ) ;
38
57
39
58
expect ( JSON . parse ( JSON . stringify ( tree . readContent ( 'angular.json' ) ) ) ) . toContain ( "stylePreprocessorOptions" ) ;
40
59
} ) ;
60
+
61
+ it ( `should not add igniteui-theming to library pacakage json and configure it` , async ( ) => {
62
+ appTree . create ( '/angular.json' , JSON . stringify ( configJsonLib ) ) ;
63
+ const tree = await schematicRunner . runSchematicAsync ( migrationName , { } , appTree )
64
+ . toPromise ( ) ;
65
+
66
+ expect ( JSON . parse ( JSON . stringify ( tree . readContent ( 'angular.json' ) ) ) ) . not . toContain ( "stylePreprocessorOptions" ) ;
67
+ } ) ;
41
68
} ) ;
0 commit comments