I have a (rather poorly written) javascript component in my application that handles infinite scroll pagination, and i\'m trying to rewrite it to use the IntersectionO
IntersectionO
I had this problem with a setup based on vue-cli. I ended up using a mix of the answers I saw above:
const mockIntersectionObserver = class { constructor() {} observe() {} unobserve() {} disconnect() {} }; beforeEach(() => { window.IntersectionObserver = mockIntersectionObserver; });