title: Jest testing react component with react-intersection-observer
body: <p>I'm trying to test a component that has a child component that includes react-intersection-observer but I always get an error </p>
  
  <p>I tried to import the library but it still fails.
  This the initial test</p>
  
  <pre><code>    beforeEach(() =&gt; {
        testContainer = document.createElement("div");
        document.body.appendChild(testContainer);
        subject = memoize(() =&gt;
          mount(&lt;FilterNav {...props} /&gt;, { attachTo: testContainer })
        );
      });
  
      afterEach(() =&gt; {
        testContainer.remove();
      });
  
      context("the main filter is shown initially", () =&gt; {
        it("sets focus on the primary filter", () =&gt; {
          subject();
          const input = testContainer.querySelector(".main-input");
          expect(document.activeElement).toEqual(input);
        });
  </code></pre>
  
  <p>I'm getting this error -> Uncaught [ReferenceError: IntersectionObserver is not defined]</p>
  
  <p>Is there a way I can mock IntersectionObserver?</p>
  
  <p>Thanks</p>