File tree 2 files changed +3
-3
lines changed
packages/schematics/angular/service-worker
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ function updateAppModule(options: ServiceWorkerOptions): Rule {
131
131
132
132
// register SW in app module
133
133
const importText =
134
- `ServiceWorkerModule.register('/ ngsw-worker.js', { enabled: environment.production })` ;
134
+ `ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })` ;
135
135
moduleSource = getTsSourceFile ( host , modulePath ) ;
136
136
const metadataChanges = addSymbolToNgModuleMetadata (
137
137
moduleSource , modulePath , 'imports' , importText ) ;
Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ describe('Service Worker Schematic', () => {
87
87
const tree = schematicRunner . runSchematic ( 'service-worker' , defaultOptions , appTree ) ;
88
88
const pkgText = tree . readContent ( '/projects/bar/src/app/app.module.ts' ) ;
89
89
// tslint:disable-next-line:max-line-length
90
- const regex = / S e r v i c e W o r k e r M o d u l e \ .r e g i s t e r \( ' \/ n g s w - w o r k e r .j s \' , { e n a b l e d : e n v i r o n m e n t .p r o d u c t i o n } \) / ;
91
- expect ( pkgText ) . toMatch ( regex ) ;
90
+ const expectedText = ' ServiceWorkerModule.register(\' ngsw-worker.js\', { enabled: environment.production })' ;
91
+ expect ( pkgText ) . toContain ( expectedText ) ;
92
92
} ) ;
93
93
94
94
it ( 'should put the ngsw-config.json file in the project root' , ( ) => {
You can’t perform that action at this time.
0 commit comments