Replies: 1 comment 18 replies
-
@aqarain here you go -> https://stackblitz.com/edit/vitejs-vite-pocipg?file=src%2F__mocks__%2Fzustand.ts in your case since you are using useStore you have to options: Export just useStore at the end // at the end
export const useStore = zustand.useStore Export everything at the beginning export * from 'zustand'
const { create: actualCreate, createStore: actualCreateStore } =
jest.requireActual<typeof zustand>('zustand');
// the rest of the code |
Beta Was this translation helpful? Give feedback.
18 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi 👋🏼,
In my small app, I am trying to set up Zustand.
__mocks__/zustand.ts
file, the second test fails because I think the store is not being reset.__mocks__/zustand.ts
file (with the configs from Zustand docs), both the test fail.Probably, I am missing something 😕
Can someone please have a look what could be missing or wrong?
Thank you 🙂
Stackblitz: https://stackblitz.com/edit/vitejs-vite-8lqgbb
Beta Was this translation helpful? Give feedback.
All reactions