I have my page working and the animation is doing what I want, I am just wanting to tests the logic of the page to make sure that is working and not the animations itself but when I try to render the the page with @testing-library/react
but when I run npm run test --clearCache I get the error
FAIL src/Pages/__tests__/splash.test.tsx
●Test suite failed to run
TypeError: _win$1.matchMedia isnot a function8|import luminaEnv from'../../env';9|>10| gsap.registerPlugin(ScrollTrigger);|^11|12|constAspectSection=({13| score,
at Function.matchMedia (node_modules/gsap/dist/ScrollTrigger.js:2442:23)
at Function.enable (node_modules/gsap/dist/ScrollTrigger.js:2340:25)
at Function.register(node_modules/gsap/dist/ScrollTrigger.js:2270:61)
at _createPlugin (node_modules/gsap/dist/gsap.js:987:31)
at node_modules/gsap/dist/gsap.js:3517:16
at Array.forEach (<anonymous>)
at Object.registerPlugin (node_modules/gsap/dist/gsap.js:3516:12)
at Object.<anonymous>(src/Components/splashPage/AspectSection.tsx:10:6)
at Object.<anonymous>(src/Pages/Splash.tsx:5:1)
at Object.<anonymous>(src/Pages/__tests__/splash.test.tsx:3:1)
Do you have any ideas? like I said I don't need to test the animation just the information that the API returns
Scrolltrigger TypeError: _win$1.matchMedia is not a function when running tests
in GSAP
Posted
I have my page working and the animation is doing what I want, I am just wanting to tests the logic of the page to make sure that is working and not the animations itself but when I try to render the the page with
@testing-library/react
The splash page imports are
but when I run
npm run test --clearCache
I get the errorDo you have any ideas? like I said I don't need to test the animation just the information that the API returns