File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
packages/schematics/angular/service-worker Expand file tree Collapse file tree 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 {
131131
132132 // register SW in app module
133133 const importText =
134- `ServiceWorkerModule.register('/ ngsw-worker.js', { enabled: environment.production })` ;
134+ `ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })` ;
135135 moduleSource = getTsSourceFile ( host , modulePath ) ;
136136 const metadataChanges = addSymbolToNgModuleMetadata (
137137 moduleSource , modulePath , 'imports' , importText ) ;
Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ describe('Service Worker Schematic', () => {
8787 const tree = schematicRunner . runSchematic ( 'service-worker' , defaultOptions , appTree ) ;
8888 const pkgText = tree . readContent ( '/projects/bar/src/app/app.module.ts' ) ;
8989 // 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 ) ;
9292 } ) ;
9393
9494 it ( 'should put the ngsw-config.json file in the project root' , ( ) => {
You can’t perform that action at this time.
0 commit comments