MCPcopy Create free account
hub / github.com/angular/angular / configTestBed

Function configTestBed

packages/service-worker/test/provider_spec.ts:51–68  ·  view source on GitHub ↗
(options: SwRegistrationOptions)

Source from the content-addressed store, hash-verified

49
50 describe('register', () => {
51 const configTestBed = async (options: SwRegistrationOptions) => {
52 if (apiFnName === provideServiceWorkerApi) {
53 TestBed.configureTestingModule({
54 providers: [
55 provideServiceWorker('sw.js', options),
56 {provide: PLATFORM_ID, useValue: 'browser'},
57 ],
58 });
59 } else {
60 TestBed.configureTestingModule({
61 imports: [ServiceWorkerModule.register('sw.js', options)],
62 providers: [{provide: PLATFORM_ID, useValue: 'browser'}],
63 });
64 }
65
66 await untilStable();
67 await waitForReadyToRegister();
68 };
69
70 it('sets the registration options', async () => {
71 await configTestBed({enabled: true, scope: 'foo', updateViaCache: 'all', type: 'classic'});

Callers 1

provider_spec.tsFile · 0.85

Calls 5

provideServiceWorkerFunction · 0.90
untilStableFunction · 0.85
waitForReadyToRegisterFunction · 0.85
registerMethod · 0.65

Tested by

no test coverage detected