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:
Alan Agius 2021-04-21 11:55:23 +02:00 committed by Jessica Janiuk
parent 30a24b6bf5
commit 6d9e3400e1
1 changed files with 2 additions and 2 deletions

View File

@ -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};