Closed princejoogie closed 2 years ago
It's a warning, so you can just ignore it but if you want to fix it add just a Resize Observer mock to your Jest environment. This API is not available in Jest DOM by default. See this for an example: https://github.com/jscottsmith/parallax-controller/blob/master/src/setupTests.ts
@jscottsmith I also get the log statement, but when the site is live (saw it on our staging). Is it safe to ignore i production too?
@petertflem hmm, seems strange -- this should only show on browsers that do not support the ResizeObserver API but most modern browser do.
Are you on an old version of Chrome?
Regardless, you can ignore it. The event help update cache when layout shifts, but won't break without it.
@jscottsmith Hm, I probably was, but my memory is fuzzy. Might have been testing on iOS 13 with Safari or Chrome, we had some other errors there. In fact, I am pretty sure I was. Either Chrome 92, but likely Safari 13, and the ResizeObserver API was introduces in 13.1, it looks like.
Thanks!
Expected Behavior
no warnings when running tests with jest
Actual Behavior
bunch of console.warn are printed when running tests
Steps to Reproduce the Problem
ParallaxProvider
in_app.tsx
then add aParallax
component to one of the elements.create a simple unit test (jest)
Environment