File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
packages/schematics/angular/web-worker Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,11 @@ function addSnippet(options: WebWorkerOptions): Rule {
62
62
return ;
63
63
}
64
64
65
+ const fileRegExp = new RegExp ( `^${ options . name } .*\.ts` ) ;
65
66
const siblingModules = host . getDir ( options . path ) . subfiles
66
- // Find all files that start with the same name, are ts files, and aren't spec files.
67
- . filter ( f => f . startsWith ( options . name ) && f . endsWith ( '.ts' ) && ! f . endsWith ( 'spec.ts' ) )
67
+ // Find all files that start with the same name, are ts files,
68
+ // and aren't spec or module files.
69
+ . filter ( f => fileRegExp . test ( f ) && ! / ( m o d u l e | s p e c ) \. t s $ / . test ( f ) )
68
70
// Sort alphabetically for consistency.
69
71
. sort ( ) ;
70
72
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { Schema as WorkspaceOptions } from '../workspace/schema';
11
11
import { Schema as WebWorkerOptions } from './schema' ;
12
12
13
13
14
- describe ( 'Service Worker Schematic' , ( ) => {
14
+ describe ( 'Web Worker Schematic' , ( ) => {
15
15
const schematicRunner = new SchematicTestRunner (
16
16
'@schematics/angular' ,
17
17
require . resolve ( '../collection.json' ) ,
@@ -35,7 +35,7 @@ describe('Service Worker Schematic', () => {
35
35
name : 'bar' ,
36
36
inlineStyle : false ,
37
37
inlineTemplate : false ,
38
- routing : false ,
38
+ routing : true ,
39
39
skipTests : false ,
40
40
skipPackageJson : false ,
41
41
} ;
You can’t perform that action at this time.
0 commit comments