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
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
-
Hello,
I have a project with vitest and react testing library.
My vite.config.ts is
I have set
globals: true,
so it should mean that I don't need to impor anything in my setup fileBut when I run a test my
inView
is alwaysfalse
I tried to add the manual config
import { resetIntersectionMocking, setupIntersectionMocking } from 'react-intersection-observer/test-utils';
Or adding in the test
mockAllIsIntersecting(true);
But nothing worked.
My version is :
"react-intersection-observer": "^9.13.0",
"vitest": "^2.0.5"
Thanks
Beta Was this translation helpful? Give feedback.
All reactions