-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
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
Usage with Jest - ReferenceError: chrome is not defined #82
Comments
bump for this aswell. |
@RobertJGabriel can you let me know if you find a fix? For now I'm just stubbing out chrome using |
You can extend the Jest behavior by providing a test setup file. You can find everything about this in their documentation. |
Any updates on this? I am unsure what @marcus-sa meant, I am first time using any testing library. |
I think @marcus-sa was referring to something like this:
However, this was not my issue. My issue is that I am using Just importing the class would throw such error, without any other needs. How I managed to fix this? - Easy. Below all your module imports, mock the polyfill with this package.
|
Personally had to import * as chrome from "sinon-chrome"; before I could use the module with typescript |
I was getting the same error so I had to declare
|
Thanks everyone. I'm thinking about submitting a PR to add these to the docs |
Anyone else running into this today, I solved by
|
I'm getting
ReferenceError: chrome is not defined
when trying to usesinon-chrome
with Jest.Can anyone help me get this working?
The text was updated successfully, but these errors were encountered: