AGENTS.md@packages/client/src/test-support · git:20260811.0dc8891 · 2026-08-11 · sha256 24de5eab0ea253b2

AGENTS.md@packages/client/src/test-support git:20260811.0dc8891A

Immutable. This exact content is served forever at /api/v1/blob/24de5eab0ea253b2.

# DOX — packages/client/src/test-support

Files in this directory. One row per source file.

| File | Purpose |
|------|---------|
| `virtualizer-jsdom.ts` | Vitest `setupFiles` shim (wired in `packages/client/vitest.config.ts`). jsdom lacks layout + `ResizeObserver`, so TanStack Virtual reads `offsetHeight`=0 and renders ZERO rows. Provides no-op `ResizeObserver` + reports tall `offsetHeight`/wide `offsetWidth` for ONLY the ChatView scroll container (`data-testid="chat-scroll-container"`), so ALL windowed rows mount for per-row content assertions (rows still measure 0). Global RTL `cleanup()` in `afterEach` unmounts every tree, then yields ONE macrotask when real timers are in effect (`vi.isFakeTimers()` guard — under fake timers nothing advances the clock and the hook would hang to the 10 s test timeout). Both halves target the same failure: `cleanup()` blocks the post-teardown scheduler flush, the yield lets an ALREADY-scheduled TanStack Virtual debounce (`virtual-core/utils.js` `setTimeout`) fire while `window` still exists — otherwise it reaches React's dispatch after the fork's jsdom is gone and the run exits 1 on `Errors 1` with every assertion passing. NOT a global `setTimeout` wrapper cancelling pending ids: that also intercepts `user-event`'s scheduling and broke the clipboard-fallback spec. See change: fix-tmux-session-shutdown-leak. `configure({ asyncUtilTimeout: 5_000 })` raises `waitFor`/`findBy*` poll ceiling under parallel-suite CPU oversubscription. Scroll/windowing BEHAVIOUR is Playwright-gated, not asserted here. See change: virtualize-chat-transcript-tanstack. |