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
I am unsussesscful in being able to update a mock during a test. If I have the following tests:
import{signIn}from"./my-module"vi.mock("./my-module",()=>{return{signIn: vi.fn(),}})test("sign in fails",async()=>{signIn.mockRejectedValue("not-allowed")constdata=awaitdoMySignInAction()expect(data.success).toBe(false)})
It doesn't seem to work. Is there a way I can do this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am unsussesscful in being able to update a mock during a test. If I have the following tests:
It doesn't seem to work. Is there a way I can do this?
Beta Was this translation helpful? Give feedback.
All reactions