MCPcopy Index your code
hub / github.com/thebuilder/react-intersection-observer / testLibraryUtil

Function testLibraryUtil

src/test-utils.ts:21–26  ·  view source on GitHub ↗

* Get the test utility object, depending on the environment. This could be either `vi` (Vitest) or `jest`. * Type is mapped to Vitest, so we don't mix in Jest types when running in Vitest.

()

Source from the content-addressed store, hash-verified

19 * Type is mapped to Vitest, so we don't mix in Jest types when running in Vitest.
20 */
21function testLibraryUtil(): typeof vi | undefined {
22 if (typeof vi !== "undefined") return vi;
23 // @ts-expect-error We don't include the Jest types
24 if (typeof jest !== "undefined") return jest;
25 return undefined;
26}
27
28/**
29 * Check if the IntersectionObserver is currently being mocked.

Callers 2

isMockingFunction · 0.85
test-utils.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…