I'd like to test the behaviour of a library when an API doesn't exist in a browser.
For example if I have the following check:
if ('serviceWorker' in navigator &&
'PushManager' in window &&
'Notification' in window &&
'showNotification' in ServiceWorkerRegistration.prototype) {
// Do something
} else {
throw new Error('Catch in test');
}
Is it possible to completely remove properties on these global scopes?
Aucun commentaire:
Enregistrer un commentaire