File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/schematics/angular/web-worker Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,11 @@ function addSnippet(options: WebWorkerOptions): Rule {
6262 return ;
6363 }
6464
65+ const fileRegExp = new RegExp ( `^${ options . name } .*\.ts` ) ;
6566 const siblingModules = host . getDir ( options . path ) . subfiles
6667 // Find all files that start with the same name, are ts files,
6768 // and aren't spec or module files.
68- . filter ( f => f . startsWith ( options . name ) && f . endsWith ( '.ts' )
69- && ! f . endsWith ( 'spec.ts' ) && ! f . endsWith ( '-.module.ts' ) )
69+ . filter ( f => fileRegExp . test ( f ) && ! / ( m o d u l e | s p e c ) \. t s $ / . test ( f ) )
7070 // Sort alphabetically for consistency.
7171 . sort ( ) ;
7272
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { Schema as WorkspaceOptions } from '../workspace/schema';
1111import { Schema as WebWorkerOptions } from './schema' ;
1212
1313
14- describe ( 'Service Worker Schematic' , ( ) => {
14+ describe ( 'Web Worker Schematic' , ( ) => {
1515 const schematicRunner = new SchematicTestRunner (
1616 '@schematics/angular' ,
1717 require . resolve ( '../collection.json' ) ,
@@ -35,7 +35,7 @@ describe('Service Worker Schematic', () => {
3535 name : 'bar' ,
3636 inlineStyle : false ,
3737 inlineTemplate : false ,
38- routing : false ,
38+ routing : true ,
3939 skipTests : false ,
4040 skipPackageJson : false ,
4141 } ;
You can’t perform that action at this time.
0 commit comments