Skip to content

Instantly share code, notes, and snippets.

@epreston
Created April 28, 2023 18:02
Show Gist options
  • Save epreston/d9448ff6d9c818041758cf53de6e5b8d to your computer and use it in GitHub Desktop.
Save epreston/d9448ff6d9c818041758cf53de6e5b8d to your computer and use it in GitHub Desktop.
IntersectionObserver - simple mock for vitest
const IntersectionObserverMock = vi.fn(() => ({
disconnect: vi.fn(),
observe: vi.fn(),
takeRecords: vi.fn(),
unobserve: vi.fn(),
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment