acvetkov / sinon-chrome

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

sinon-chrome-webextensions.min.js uses the chrome namespace #100

Open jobara opened 4 years ago

jobara commented 4 years ago

When trying to use sinon-chrome-webextension.min.js for unit tests in a web browser, it does not stub the browser namespace but rather the chrome namespace. This requires a workaround in the test to remap the namespace to browser from chrome. Ideally the sinon-chrome-webextension.min.js uses the browser namespace as it's intended to mock those APIs.

I'm not sure if this is the issue, but potentially the problem is related to https://github.com/acvetkov/sinon-chrome/blob/master/webpack.config.js#L34