@@ -6,7 +6,9 @@ describe('getServiceWorkerRegistration', () => {
66 it ( 'returns the current registration when one exists' , async ( ) => {
77 const registration = { scope : 'https://example.com/' } as ServiceWorkerRegistration ;
88 const serviceWorker = {
9- getRegistration : vi . fn ( ) . mockResolvedValue ( registration ) ,
9+ getRegistration : vi
10+ . fn < ServiceWorkerContainer [ 'getRegistration' ] > ( )
11+ . mockResolvedValue ( registration ) ,
1012 ready : new Promise < ServiceWorkerRegistration > ( ( ) => undefined ) ,
1113 } as Pick < ServiceWorkerContainer , 'getRegistration' | 'ready' > ;
1214
@@ -16,7 +18,9 @@ describe('getServiceWorkerRegistration', () => {
1618
1719 it ( 'does not block on serviceWorker.ready when no registration exists' , async ( ) => {
1820 const serviceWorker = {
19- getRegistration : vi . fn ( ) . mockResolvedValue ( undefined ) ,
21+ getRegistration : vi
22+ . fn < ServiceWorkerContainer [ 'getRegistration' ] > ( )
23+ . mockResolvedValue ( undefined ) ,
2024 ready : new Promise < ServiceWorkerRegistration > ( ( ) => undefined ) ,
2125 } as Pick < ServiceWorkerContainer , 'getRegistration' | 'ready' > ;
2226
@@ -26,7 +30,9 @@ describe('getServiceWorkerRegistration', () => {
2630
2731 it ( 'returns undefined when registration lookup fails' , async ( ) => {
2832 const serviceWorker = {
29- getRegistration : vi . fn ( ) . mockRejectedValue ( new Error ( 'boom' ) ) ,
33+ getRegistration : vi
34+ . fn < ServiceWorkerContainer [ 'getRegistration' ] > ( )
35+ . mockRejectedValue ( new Error ( 'boom' ) ) ,
3036 ready : new Promise < ServiceWorkerRegistration > ( ( ) => undefined ) ,
3137 } as Pick < ServiceWorkerContainer , 'getRegistration' | 'ready' > ;
3238
0 commit comments