react-intersection-observer-hook icon indicating copy to clipboard operation
react-intersection-observer-hook copied to clipboard

Create-React-App testing fails

Open lunush opened this issue 4 years ago • 0 comments

Hi there,

I have a react component that uses your react-infinite-scroll-hook and couldn't get tests for it to work properly. I would always get the following error:

ReferenceError: IntersectionObserver is not defined

Here is a minimal reproduction example. I also used intersetion-observer polyfill as a workaround for this issue and it seems to work fine. Just toggle the first import statement in App.js.

By the way, when I tried testing that component with plain @testing-library/react, it worked just fine.

lunush avatar Jun 29 '21 06:06 lunush