Relative Content

Tag Archive for typescriptunit-testingreact-testing-libraryvitestmobx-state-tree

waitFor running a false positive for mocked function

I have a React/TypeScript project that I’m using mobx-state-tree for state management. In one of my tests (using Vitest + React Testing Library), I mocked a function defined in one of the stores in the state tree, so I can test for its call (it should get called in a useEffect on mount).