test(service-worker): replace `global || window` with `globalThis` (#41739)
`global` property is not available in the browser, previously this was polyfilled through `core-js`. This now fails with `global is not defined`, since global cannot be accessed when not defined. PR Close #41739
This commit is contained in:
parent
30a24b6bf5
commit
6d9e3400e1
|
@ -91,7 +91,7 @@ import {MockPushManager, MockPushSubscription, MockServiceWorkerContainer, MockS
|
|||
],
|
||||
});
|
||||
|
||||
const context: any = global || window;
|
||||
const context: any = globalThis;
|
||||
const originalDescriptor = Object.getOwnPropertyDescriptor(context, 'navigator');
|
||||
const patchedDescriptor = {value: {serviceWorker: undefined}, configurable: true};
|
||||
|
||||
|
@ -120,7 +120,7 @@ import {MockPushManager, MockPushSubscription, MockServiceWorkerContainer, MockS
|
|||
]
|
||||
});
|
||||
|
||||
const context: any = global || window;
|
||||
const context: any = globalThis;
|
||||
const originalDescriptor = Object.getOwnPropertyDescriptor(context, 'navigator');
|
||||
const patchedDescriptor = {value: {serviceWorker: mock}, configurable: true};
|
||||
|
||||
|
|
Loading…
Reference in New Issue