We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am not sure exactly how to actually trigger a connection using sinon-chrome. Here is my test:
const browser = require('sinon-chrome/webextensions'); const sinon = require('sinon'); it("multiple content scripts can connect to the same background script", () => { let onConnect = sinon.spy(); browser.runtime.onConnect.addListener(onConnect); browser.runtime.connect(null, { name: 'one' }); browser.runtime.connect(null, { name: 'two' }); browser.runtime.onConnect.trigger(); browser.runtime.onConnect.trigger(); assert(onConnect.callCount === 2, 'on connect has been called 2 times'); });
This seems to work but I am not sure why. I was expecting that I don't need to call browser.runtime.onConnect.trigger();
browser.runtime.onConnect.trigger();
What is the best way to improve documentation? I have a hard time using sinon-chrome as a new user.
sinon-chrome
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am not sure exactly how to actually trigger a connection using sinon-chrome.
Here is my test:
This seems to work but I am not sure why. I was expecting that I don't need to call
browser.runtime.onConnect.trigger();
What is the best way to improve documentation? I have a hard time using
sinon-chrome
as a new user.The text was updated successfully, but these errors were encountered: