Reactjs – VITEST Hook mocked on test dont return desired value
I have three files: use-user-info.ts user-info.tsx user-info.test.tsx I want to test the behaviour of the component UserInfo (exported from user-info.tsx). On my test file I mock the hook like this: vi.mock("@/use-user-info"); describe(() => { beforeEach(() => { vi.mocked("@/use-user-info").mockReturnValue({ userId: 1,…