@@ -51,7 +51,6 @@ describe('Application Schematic', () => {
51
51
'/projects/foo/karma.conf.js' ,
52
52
'/projects/foo/tsconfig.app.json' ,
53
53
'/projects/foo/tsconfig.spec.json' ,
54
- '/projects/foo/tslint.json' ,
55
54
'/projects/foo/src/environments/environment.ts' ,
56
55
'/projects/foo/src/environments/environment.prod.ts' ,
57
56
'/projects/foo/src/favicon.ico' ,
@@ -153,42 +152,21 @@ describe('Application Schematic', () => {
153
152
expect ( _extends ) . toBe ( '../../tsconfig.json' ) ;
154
153
} ) ;
155
154
156
- it ( 'should set the right path and prefix in the tslint file' , async ( ) => {
157
- const tree = await schematicRunner . runSchematicAsync ( 'application' , defaultOptions , workspaceTree )
158
- . toPromise ( ) ;
159
- const path = '/projects/foo/tslint.json' ;
160
- const content = JSON . parse ( tree . readContent ( path ) ) ;
161
- expect ( content . extends ) . toMatch ( '../../tslint.json' ) ;
162
- expect ( content . rules [ 'directive-selector' ] [ 2 ] ) . toMatch ( 'app' ) ;
163
- expect ( content . rules [ 'component-selector' ] [ 2 ] ) . toMatch ( 'app' ) ;
164
- } ) ;
165
-
166
- it ( 'should set the right prefix in the tslint file when provided is kebabed' , async ( ) => {
167
- const options : ApplicationOptions = { ...defaultOptions , prefix : 'foo-bar' } ;
168
- const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
169
- . toPromise ( ) ;
170
- const path = '/projects/foo/tslint.json' ;
171
- const content = JSON . parse ( tree . readContent ( path ) ) ;
172
- expect ( content . rules [ 'directive-selector' ] [ 2 ] ) . toMatch ( 'fooBar' ) ;
173
- expect ( content . rules [ 'component-selector' ] [ 2 ] ) . toMatch ( 'foo-bar' ) ;
174
- } ) ;
175
-
176
155
it ( 'should set the right coverage folder in the karma.json file' , async ( ) => {
177
156
const tree = await schematicRunner . runSchematicAsync ( 'application' , defaultOptions , workspaceTree )
178
157
. toPromise ( ) ;
179
158
const karmaConf = getFileContent ( tree , '/projects/foo/karma.conf.js' ) ;
180
159
expect ( karmaConf ) . toContain ( `dir: require('path').join(__dirname, '../../coverage/foo')` ) ;
181
160
} ) ;
182
161
183
- it ( 'minimal=true should not create e2e, lint and test targets' , async ( ) => {
162
+ it ( 'minimal=true should not create e2e and test targets' , async ( ) => {
184
163
const options = { ...defaultOptions , minimal : true } ;
185
164
const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
186
165
. toPromise ( ) ;
187
166
const config = JSON . parse ( tree . readContent ( '/angular.json' ) ) ;
188
167
const architect = config . projects . foo . architect ;
189
168
expect ( architect . test ) . not . toBeDefined ( ) ;
190
169
expect ( architect . e2e ) . not . toBeDefined ( ) ;
191
- expect ( architect . e2e ) . not . toBeDefined ( ) ;
192
170
} ) ;
193
171
194
172
it ( 'minimal=true should configure the schematics options for components' , async ( ) => {
@@ -235,7 +213,6 @@ describe('Application Schematic', () => {
235
213
const files = tree . files ;
236
214
[
237
215
'/projects/foo/tsconfig.spec.json' ,
238
- '/projects/foo/tslint.json' ,
239
216
'/projects/foo/karma.conf.js' ,
240
217
'/projects/foo/src/test.ts' ,
241
218
'/projects/foo/src/app/app.component.css' ,
@@ -264,7 +241,6 @@ describe('Application Schematic', () => {
264
241
const files = tree . files ;
265
242
[
266
243
'/projects/foo/tsconfig.spec.json' ,
267
- '/projects/foo/tslint.json' ,
268
244
'/projects/foo/karma.conf.js' ,
269
245
'/projects/foo/src/test.ts' ,
270
246
'/projects/foo/src/app/app.component.html' ,
@@ -293,7 +269,6 @@ describe('Application Schematic', () => {
293
269
const files = tree . files ;
294
270
[
295
271
'/projects/foo/tsconfig.spec.json' ,
296
- '/projects/foo/tslint.json' ,
297
272
'/projects/foo/karma.conf.js' ,
298
273
'/projects/foo/src/test.ts' ,
299
274
'/projects/foo/src/app/app.component.css' ,
@@ -355,18 +330,6 @@ describe('Application Schematic', () => {
355
330
const packageJson = JSON . parse ( tree . readContent ( 'package.json' ) ) ;
356
331
expect ( packageJson . devDependencies [ '@angular-devkit/build-angular' ] ) . toBeUndefined ( ) ;
357
332
} ) ;
358
-
359
- it ( 'should set the lint tsConfig option' , async ( ) => {
360
- const tree = await schematicRunner . runSchematicAsync ( 'application' , defaultOptions , workspaceTree )
361
- . toPromise ( ) ;
362
- const workspace = JSON . parse ( tree . readContent ( '/angular.json' ) ) ;
363
- const lintOptions = workspace . projects . foo . architect . lint . options ;
364
- expect ( lintOptions . tsConfig ) . toEqual ( [
365
- 'projects/foo/tsconfig.app.json' ,
366
- 'projects/foo/tsconfig.spec.json' ,
367
- 'projects/foo/e2e/tsconfig.json' ,
368
- ] ) ;
369
- } ) ;
370
333
} ) ;
371
334
372
335
describe ( 'custom projectRoot' , ( ) => {
@@ -380,7 +343,6 @@ describe('Application Schematic', () => {
380
343
'/karma.conf.js' ,
381
344
'/tsconfig.app.json' ,
382
345
'/tsconfig.spec.json' ,
383
- '/tslint.json' ,
384
346
'/src/environments/environment.ts' ,
385
347
'/src/environments/environment.prod.ts' ,
386
348
'/src/favicon.ico' ,
@@ -448,31 +410,6 @@ describe('Application Schematic', () => {
448
410
expect ( specTsConfig . files ) . toEqual ( [ 'src/test.ts' , 'src/polyfills.ts' ] ) ;
449
411
} ) ;
450
412
451
- it ( 'should set the relative path and prefix in the tslint file' , async ( ) => {
452
- const options = { ...defaultOptions , projectRoot : '' } ;
453
-
454
- const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
455
- . toPromise ( ) ;
456
- const content = JSON . parse ( tree . readContent ( '/tslint.json' ) ) ;
457
- expect ( content . extends ) . toMatch ( 'tslint:recommended' ) ;
458
- expect ( content . rules [ 'directive-selector' ] [ 2 ] ) . toMatch ( 'app' ) ;
459
- expect ( content . rules [ 'component-selector' ] [ 2 ] ) . toMatch ( 'app' ) ;
460
- } ) ;
461
-
462
- it ( 'should merge tslint file' , async ( ) => {
463
- const options = { ...defaultOptions , projectRoot : '' } ;
464
-
465
- const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
466
- . toPromise ( ) ;
467
- const content = JSON . parse ( tree . readContent ( '/tslint.json' ) ) ;
468
- expect ( content . extends ) . toMatch ( 'tslint:recommended' ) ;
469
- expect ( content . rules [ 'component-selector' ] [ 2 ] ) . toMatch ( 'app' ) ;
470
- expect ( content . rules [ 'no-console' ] ) . toBeDefined ( ) ;
471
- // codelyzer rules should be after base tslint rules
472
- expect ( Object . keys ( content . rules ) . indexOf ( 'component-selector' ) )
473
- . toBeGreaterThan ( Object . keys ( content . rules ) . indexOf ( 'no-console' ) ) ;
474
- } ) ;
475
-
476
413
it ( `should create correct paths when 'newProjectRoot' is blank` , async ( ) => {
477
414
const workspaceTree = await schematicRunner . runSchematicAsync ( 'workspace' , { ...workspaceOptions , newProjectRoot : '' } ) . toPromise ( ) ;
478
415
const options = { ...defaultOptions , projectRoot : undefined } ;
0 commit comments