-
Notifications
You must be signed in to change notification settings - Fork 37
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
mock mockReturnValue doesn't work #95
Comments
This has nothing to do with swc, its jest issue |
also mockReturnvalue is a setter, not sure if that will return anything |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use last version of React and try to write test in Jest:
const getItemSpy = jest.spyOn(localStorage, 'getItem');
getItemSpy.mockReturnValue(null);
and got error:
TypeError: getItemSpy.mockReturnValue is not a function
If I run:
console.log(getItemSpy.mockReturnValue);
It shows undefined
What's the problem?
The text was updated successfully, but these errors were encountered: