⬅️ Back to Table of Contents
📄 index.test.ts
📊 Analysis Summary
| Metric |
Count |
| 🔧 Functions |
2 |
| 📦 Imports |
7 |
| 📊 Variables & Constants |
4 |
📚 Table of Contents
🛠️ File Location:
📂 packages/core/useElementVisibility/index.test.ts
📦 Imports
| Name |
Source |
beforeAll |
vitest |
beforeEach |
vitest |
describe |
vitest |
expect |
vitest |
it |
vitest |
vi |
vitest |
useElementVisibility |
./index |
Variables & Constants
| Name |
Type |
Kind |
Value |
Exported |
el |
HTMLDivElement |
let/var |
*not shown* |
✗ |
callback |
any |
const |
vi.mocked(useIntersectionObserver).mock.lastCall?.[1] |
✗ |
callback |
any |
const |
vi.mocked(useIntersectionObserver).mock.lastCall?.[1] |
✗ |
mockWindow |
Window |
const |
{} as Window |
✗ |
Functions
callMockCallbackWithIsIntersectingValue(isIntersecting: boolean): any
Code
(isIntersecting: boolean) => callback?.([{ isIntersecting, time: 1 } as IntersectionObserverEntry], {} as IntersectionObserver)
- Parameters:
isIntersecting: boolean
- Return Type:
any
- Calls:
callback
callMockCallbackWithIsIntersectingValues(entries: { isIntersecting: boolean, time: number }[]): void
Code
(...entries: { isIntersecting: boolean, time: number }[]) => {
callback?.(entries as IntersectionObserverEntry[], {} as IntersectionObserver)
}
- Parameters:
entries: { isIntersecting: boolean, time: number }[]
- Return Type:
void
- Calls:
callback