acvetkov / sinon-chrome

Testing chrome extensions with Node.js
ISC License
434 stars 46 forks source link

How to remove the registred plugin ? #74

Open Dakad opened 6 years ago

Dakad commented 6 years ago

I'm writing some unit test for a chrome-extension and I was testing the function that uses chrome.i18n.getMessage(). Each test passes smoothly at first but I have to skip the second test on the specific function. image.

But after testing my function by removing the skip at line 57, that happens :

image

According to the Wiki about Cookie plugin, I assume the registered plugin must be removed after the test in order to restore the sinon stubs. I tried the chrome.flush() and delete chrome, both didn't work.

❓ Does somebody know to do this ❓

acvetkov commented 6 years ago

Unfortunatelly, there is no way to remove registered plugins. Feel free to open pull request!