You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm trying to test chrome.storage.local.get and chrome.storage.local.set, but I'm struggling to have my typscript environment, more specifically ts-jest understand that mockClear actually exists as per:
beforeEach(()=>{chrome.storage.local.get.mockClear();// Property 'mockClear' does not exist on type ... ...});
I've managed to setup a similar project called jest-fetch-mock, and if I dig into their source, I can see that they have types such as:
defined in their project. And I can't seem to find something similar in this project.
Could it be that my project doesn't understand that the implementations has actually created functions such as mockClear? Perhaps this project doesn't support typescript testing? If so, maybe I could declare something for the functions I'm using. I just want to make sure I'm not misunderstanding something that you've documented somewhere.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Perhaps this project doesn't support typescript testing? If so, maybe I could declare something for the functions I'm using. I just want to make sure I'm not misunderstanding something that you've documented somewhere.
Yes, right now we don't have types supported. But I'd be happy to take a PR for those.
Hi! This seems to be a fantastic project.
Currently I'm trying to test
chrome.storage.local.get
andchrome.storage.local.set
, but I'm struggling to have my typscript environment, more specificallyts-jest
understand thatmockClear
actually exists as per:I've managed to setup a similar project called jest-fetch-mock, and if I dig into their source, I can see that they have types such as:
defined in their project. And I can't seem to find something similar in this project.
Could it be that my project doesn't understand that the implementations has actually created functions such as
mockClear
? Perhaps this project doesn't support typescript testing? If so, maybe I coulddeclare
something for the functions I'm using. I just want to make sure I'm not misunderstanding something that you've documented somewhere.Thanks in advance!
The text was updated successfully, but these errors were encountered: