Apply the AGENTS.md comments guideline to every .ts under tests/: remove what the code already expresses, keep only what it cannot. Removed: spec-header coverage inventories the describe/test tree already names; comments restating the next line's assertion or its message; helper JSDoc whose body already says it; within-file duplicates; five stale claims (trendChart's "six aggregated turns" against agg.length === 8, agentGraph's "six categories" against CATS' seven, fold-timing's "cheapest call LAST" against a loop that feeds it first, fold-surface's unreachable plain-JSON note, contextView's "two turns" for a one-turn fixture). Kept and condensed: the projection-freeze class, strict wire/state-schema hazards, retention and pricing windows, pairing rules, hostile-input rationale, fixture and expectation-array ground truth, jsdom mechanics, and issue-numbered regressions. Comment lines 2604 -> 2014 (-22%); 85 module headers kept, 30 coverage inventories dropped; every surviving comment line is within the 140-column limit, with 36 wrapped lines joined onto fuller ones. No logic, string, identifier, import or directive changed: a comment-strip gate proves each file's comment-free code is byte-identical to HEAD, and a line-level proof pairs all 845 changed lines with an unchanged code part. pnpm run lint && pnpm run test (106 files / 2061 tests, per-file 100% coverage) && pnpm run build all pass.
16 lines
866 B
TypeScript
16 lines
866 B
TypeScript
// Client project setup: React 18 `act` requires this flag to flush effects synchronously in tests.
|
|
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
|
|
|
|
import { resetModelPrices, setModelPricesLoader } from '../../src/client/modelPrices'
|
|
|
|
// jsdom does not implement scrollIntoView; the plugin calls it when focusing
|
|
// a browser row. A no-op polyfill stands in for the platform (layout-free).
|
|
if (typeof Element !== 'undefined' && Element.prototype.scrollIntoView === undefined) {
|
|
Element.prototype.scrollIntoView = () => {}
|
|
}
|
|
|
|
// The model-price store starts DORMANT in tests: its loader resolves never, so no spec ever reaches the network. Specs that need prices
|
|
// inject their own loader (resetModelPrices + setModelPricesLoader, see modelPrices.spec).
|
|
resetModelPrices()
|
|
setModelPricesLoader(() => new Promise(() => {}))
|