@@ -71,7 +71,7 @@ describe('ng-add schematics', () => {
7171 it ( 'should add packages to package.json dependencies' , async ( ) => {
7272 const expectedDeps = DEPENDENCIES_MAP . filter ( dep => dep . target === PackageTarget . REGULAR ) . map ( dep => dep . name ) ;
7373 const expectedDevDeps = DEPENDENCIES_MAP . filter ( dep => dep . target === PackageTarget . DEV ) . map ( dep => dep . name ) ;
74- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
74+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
7575 const pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
7676 expect ( pkgJsonData . dependencies ) . toBeTruthy ( ) ;
7777 expect ( pkgJsonData . devDependencies ) . toBeTruthy ( ) ;
@@ -87,32 +87,32 @@ describe('ng-add schematics', () => {
8787 } ) ;
8888
8989 it ( 'should add the correct igniteui-angular packages to package.json dependencies' , async ( ) => {
90- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
90+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
9191 const pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
9292 expect ( pkgJsonData . dependencies [ 'fflate' ] ) . toBeTruthy ( ) ;
9393 expect ( pkgJsonData . dependencies [ 'hammerjs' ] ) . toBeTruthy ( ) ;
9494 } ) ;
9595
9696 it ( 'should NOT add hammer.js to the main.ts file' , async ( ) => {
97- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
97+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
9898 const mainTs = tree . read ( `${ sourceRoot } /main.ts` ) . toString ( ) ;
9999 expect ( mainTs ) . not . toContain ( 'import \'hammerjs\';' ) ;
100100 } ) ;
101101
102102 it ( 'should NOT add hammer.js to the test.ts file' , async ( ) => {
103- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
103+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
104104 const testTs = tree . read ( `${ sourceRoot } /test.ts` ) . toString ( ) ;
105105 expect ( testTs ) . not . toContain ( 'import \'hammerjs\';' ) ;
106106 } ) ;
107107
108108 it ( 'should add hammer.js in angular.json build options under scripts' , async ( ) => {
109- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
109+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
110110 const ngJsonConfigResult = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
111111 expect ( ngJsonConfigResult . projects . testProj . architect . build . options . scripts ) . toContain ( './node_modules/hammerjs/hammer.min.js' ) ;
112112 } ) ;
113113
114114 it ( 'should add hammer.js in angular.json test options under scripts' , async ( ) => {
115- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
115+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
116116 const ngJsonConfigResult = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
117117 expect ( ngJsonConfigResult . projects . testProj . architect . test . options . scripts ) . toContain ( './node_modules/hammerjs/hammer.min.js' ) ;
118118 } ) ;
@@ -121,7 +121,7 @@ describe('ng-add schematics', () => {
121121 const ngJsonConfig1 = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
122122 ngJsonConfig1 . projects . testProj . architect . build . options . scripts . push ( './node_modules/hammerjs/hammer.min.js' ) ;
123123 tree . overwrite ( '/angular.json' , JSON . stringify ( ngJsonConfig1 ) ) ;
124- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
124+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
125125
126126 const ngJsonConfigResult = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
127127 expect ( ngJsonConfigResult . projects . testProj . architect . build . options . scripts . length ) . toBe ( 1 ) ;
@@ -132,7 +132,7 @@ describe('ng-add schematics', () => {
132132 const ngJsonConfig1 = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
133133 ngJsonConfig1 . projects . testProj . architect . test . options . scripts . push ( './node_modules/hammerjs/hammer.min.js' ) ;
134134 tree . overwrite ( '/angular.json' , JSON . stringify ( ngJsonConfig1 ) ) ;
135- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
135+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
136136
137137 const ngJsonConfigResult = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
138138 expect ( ngJsonConfigResult . projects . testProj . architect . test . options . scripts . length ) . toBe ( 1 ) ;
@@ -143,7 +143,7 @@ describe('ng-add schematics', () => {
143143 const ngJsonConfig1 = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
144144 ngJsonConfig1 . projects . testProj . architect . build . options . scripts . push ( './node_modules/hammerjs/hammer.min.js' ) ;
145145 tree . overwrite ( '/angular.json' , JSON . stringify ( ngJsonConfig1 ) ) ;
146- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
146+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
147147
148148 const newContent = tree . read ( `${ sourceRoot } /main.ts` ) . toString ( ) ;
149149 expect ( newContent ) . toMatch ( '// test comment' ) ;
@@ -153,14 +153,14 @@ describe('ng-add schematics', () => {
153153 const ngJsonConfig1 = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
154154 ngJsonConfig1 . projects . testProj . architect . test . options . scripts . push ( './node_modules/hammerjs/hammer.min.js' ) ;
155155 tree . overwrite ( '/angular.json' , JSON . stringify ( ngJsonConfig1 ) ) ;
156- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
156+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
157157
158158 const newContent = tree . read ( `${ sourceRoot } /test.ts` ) . toString ( ) ;
159159 expect ( newContent ) . toMatch ( '// test comment' ) ;
160160 } ) ;
161161
162162 it ( 'should add hammer.js to package.json dependencies' , async ( ) => {
163- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
163+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
164164 const pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
165165 expect ( pkgJsonData . dependencies [ 'hammerjs' ] ) . toBeTruthy ( ) ;
166166 } ) ;
@@ -169,15 +169,15 @@ describe('ng-add schematics', () => {
169169 const mainTsPath = `${ sourceRoot } /main.ts` ;
170170 const content = tree . read ( mainTsPath ) . toString ( ) ;
171171 tree . overwrite ( mainTsPath , 'import \'hammerjs\';\n' + content ) ;
172- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
172+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
173173
174174 const ngJsonConfigResult = JSON . parse ( tree . read ( '/angular.json' ) . toString ( ) ) ;
175175 expect ( ngJsonConfigResult . projects . testProj . architect . build . options . scripts . length ) . toBe ( 0 ) ;
176176 expect ( ngJsonConfigResult . projects . testProj . architect . build . options . scripts ) . not . toContain ( './node_modules/hammerjs/hammer.min.js' ) ;
177177 } ) ;
178178
179179 it ( 'should add the CLI only to devDependencies' , async ( ) => {
180- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : false } , tree ) . toPromise ( ) ;
180+ await runner . runSchematic ( 'ng-add' , { normalizeCss : false } , tree ) ;
181181 const pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
182182
183183 const version = require ( '../../package.json' ) [ 'igxDevDependencies' ] [ '@igniteui/angular-schematics' ] ;
@@ -187,23 +187,23 @@ describe('ng-add schematics', () => {
187187
188188 it ( 'should properly add css reset' , async ( ) => {
189189 tree . create ( `${ sourceRoot } /styles.scss` , '' ) ;
190- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : true } , tree ) . toPromise ( ) ;
190+ await runner . runSchematic ( 'ng-add' , { normalizeCss : true } , tree ) ;
191191 let pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
192192 expect ( tree . readContent ( `${ sourceRoot } /styles.scss` ) ) . toEqual ( scssImport ) ;
193193 expect ( pkgJsonData . dependencies [ 'minireset.css' ] ) . toBeTruthy ( ) ;
194194 resetJsonConfigs ( tree ) ;
195195 tree . delete ( `${ sourceRoot } /styles.scss` ) ;
196196
197197 tree . create ( `${ sourceRoot } /styles.sass` , '' ) ;
198- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : true } , tree ) . toPromise ( ) ;
198+ await runner . runSchematic ( 'ng-add' , { normalizeCss : true } , tree ) ;
199199 pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
200200 expect ( tree . readContent ( `${ sourceRoot } /styles.sass` ) ) . toEqual ( scssImport ) ;
201201 expect ( pkgJsonData . dependencies [ 'minireset.css' ] ) . toBeTruthy ( ) ;
202202 resetJsonConfigs ( tree ) ;
203203 tree . delete ( `${ sourceRoot } /styles.sass` ) ;
204204
205205 tree . create ( `${ sourceRoot } /styles.css` , '' ) ;
206- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : true } , tree ) . toPromise ( ) ;
206+ await runner . runSchematic ( 'ng-add' , { normalizeCss : true } , tree ) ;
207207 pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
208208 expect ( tree . readContent ( `${ sourceRoot } /styles.css` ) ) . toBe ( '' ) ;
209209 expect ( pkgJsonData . dependencies [ 'minireset.css' ] ) . toBeTruthy ( ) ;
@@ -212,7 +212,7 @@ describe('ng-add schematics', () => {
212212 tree . delete ( `${ sourceRoot } /styles.css` ) ;
213213
214214 tree . create ( `${ sourceRoot } /styles.less` , '' ) ;
215- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : true } , tree ) . toPromise ( ) ;
215+ await runner . runSchematic ( 'ng-add' , { normalizeCss : true } , tree ) ;
216216 pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
217217 expect ( tree . readContent ( `${ sourceRoot } /styles.less` ) ) . toBe ( '' ) ;
218218 expect ( pkgJsonData . dependencies [ 'minireset.css' ] ) . toBeTruthy ( ) ;
@@ -221,7 +221,7 @@ describe('ng-add schematics', () => {
221221 tree . delete ( `${ sourceRoot } /styles.less` ) ;
222222
223223 tree . create ( `${ sourceRoot } /styles.styl` , '' ) ;
224- await runner . runSchematicAsync ( 'ng-add' , { normalizeCss : true } , tree ) . toPromise ( ) ;
224+ await runner . runSchematic ( 'ng-add' , { normalizeCss : true } , tree ) ;
225225 pkgJsonData = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
226226 expect ( tree . readContent ( `${ sourceRoot } /styles.styl` ) ) . toBe ( '' ) ;
227227 expect ( pkgJsonData . dependencies [ 'minireset.css' ] ) . toBeTruthy ( ) ;
0 commit comments