@@ -51,7 +51,6 @@ describe('Application Schematic', () => {
5151 '/projects/foo/karma.conf.js' ,
5252 '/projects/foo/tsconfig.app.json' ,
5353 '/projects/foo/tsconfig.spec.json' ,
54- '/projects/foo/tslint.json' ,
5554 '/projects/foo/src/environments/environment.ts' ,
5655 '/projects/foo/src/environments/environment.prod.ts' ,
5756 '/projects/foo/src/favicon.ico' ,
@@ -153,42 +152,21 @@ describe('Application Schematic', () => {
153152 expect ( _extends ) . toBe ( '../../tsconfig.json' ) ;
154153 } ) ;
155154
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-
176155 it ( 'should set the right coverage folder in the karma.json file' , async ( ) => {
177156 const tree = await schematicRunner . runSchematicAsync ( 'application' , defaultOptions , workspaceTree )
178157 . toPromise ( ) ;
179158 const karmaConf = getFileContent ( tree , '/projects/foo/karma.conf.js' ) ;
180159 expect ( karmaConf ) . toContain ( `dir: require('path').join(__dirname, '../../coverage/foo')` ) ;
181160 } ) ;
182161
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 ( ) => {
184163 const options = { ...defaultOptions , minimal : true } ;
185164 const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
186165 . toPromise ( ) ;
187166 const config = JSON . parse ( tree . readContent ( '/angular.json' ) ) ;
188167 const architect = config . projects . foo . architect ;
189168 expect ( architect . test ) . not . toBeDefined ( ) ;
190169 expect ( architect . e2e ) . not . toBeDefined ( ) ;
191- expect ( architect . e2e ) . not . toBeDefined ( ) ;
192170 } ) ;
193171
194172 it ( 'minimal=true should configure the schematics options for components' , async ( ) => {
@@ -235,7 +213,6 @@ describe('Application Schematic', () => {
235213 const files = tree . files ;
236214 [
237215 '/projects/foo/tsconfig.spec.json' ,
238- '/projects/foo/tslint.json' ,
239216 '/projects/foo/karma.conf.js' ,
240217 '/projects/foo/src/test.ts' ,
241218 '/projects/foo/src/app/app.component.css' ,
@@ -264,7 +241,6 @@ describe('Application Schematic', () => {
264241 const files = tree . files ;
265242 [
266243 '/projects/foo/tsconfig.spec.json' ,
267- '/projects/foo/tslint.json' ,
268244 '/projects/foo/karma.conf.js' ,
269245 '/projects/foo/src/test.ts' ,
270246 '/projects/foo/src/app/app.component.html' ,
@@ -293,7 +269,6 @@ describe('Application Schematic', () => {
293269 const files = tree . files ;
294270 [
295271 '/projects/foo/tsconfig.spec.json' ,
296- '/projects/foo/tslint.json' ,
297272 '/projects/foo/karma.conf.js' ,
298273 '/projects/foo/src/test.ts' ,
299274 '/projects/foo/src/app/app.component.css' ,
@@ -355,18 +330,6 @@ describe('Application Schematic', () => {
355330 const packageJson = JSON . parse ( tree . readContent ( 'package.json' ) ) ;
356331 expect ( packageJson . devDependencies [ '@angular-devkit/build-angular' ] ) . toBeUndefined ( ) ;
357332 } ) ;
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- } ) ;
370333 } ) ;
371334
372335 describe ( 'custom projectRoot' , ( ) => {
@@ -380,7 +343,6 @@ describe('Application Schematic', () => {
380343 '/karma.conf.js' ,
381344 '/tsconfig.app.json' ,
382345 '/tsconfig.spec.json' ,
383- '/tslint.json' ,
384346 '/src/environments/environment.ts' ,
385347 '/src/environments/environment.prod.ts' ,
386348 '/src/favicon.ico' ,
@@ -448,31 +410,6 @@ describe('Application Schematic', () => {
448410 expect ( specTsConfig . files ) . toEqual ( [ 'src/test.ts' , 'src/polyfills.ts' ] ) ;
449411 } ) ;
450412
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-
476413 it ( `should create correct paths when 'newProjectRoot' is blank` , async ( ) => {
477414 const workspaceTree = await schematicRunner . runSchematicAsync ( 'workspace' , { ...workspaceOptions , newProjectRoot : '' } ) . toPromise ( ) ;
478415 const options = { ...defaultOptions , projectRoot : undefined } ;
0 commit comments