Skip to content
Petar Liovic edited this page Sep 9, 2026 · 1 revision

What the suite is for: same trace → same flags, no crash on empty/HMR/unmount, wrappers match React, production shims stay dumb.

23 files. If you change detection, start with math.test.ts, engine.logic.test.ts, and graph.test.ts.

Math and ranking

math.test.ts — overlap on the ring: wrap at the seam, swap A/B, idle rings don’t go NaN, work stays cheap.
(If this file still asserts cosine > 0.88 as a hit, change it. Hits are rarity + 65% floor.)

graph.test.ts — ranking on toy graphs: star, chain, cycle, self-loop ignored, weights, two disconnected clumps, empty graph.

ranker.test.ts — those scores → report lines: same fan-out merged, single-target events omitted, effects vs state, context not listed as “fix this hook,” empty graph falls back to density, anonymous events borrow a filename.

Engine and lifecycle

engine.logic.test.ts — when a pair is compared: already-flagged stays flagged while idle, context copy vs two contexts, first tick is not a duplicate, hot streams suppressed, no work if nothing is dirty, no A vs A.

graph-ttl.test.ts — old Event_Tick_* nodes drop after TTL; real state keys are not deleted by a sloppy name match; prune off when debug is off.

hmr.test.tsvi.resetModules() still sees the same globalThis instance.

lifecycle-cleanup.test.tsx — 50 mount/unmount cycles; graph size must plateau (regression for unregister leaving edges).

instance-identity.test.tsx — two rows of the same component don’t share a ring; unmount one, the other stays; same label at two call sites doesn’t collapse.

Hooks

hooks.test.tsx / hooks19.test.tsx — roles, effect as source, anon labels without Babel, label frozen on first render, React 19 actions.

react19-esm-compat.test.ts — source grep: no static useOptimistic / useActionState / use import from react (breaks pre-19 ESM).

tracking.test.tsx — manual beginEffectTracking / endEffectTracking.

temporal.test.tsx — same frame vs next frame.

production.test.tsx — shims don’t throw; provider is a passthrough.

babel-plugin.test.ts — labels, React.useState, idempotent, line suffix, both useReducer forms, @basis-ignore, aliased imports.

Reports and UI

reports.test.ts — suggestion text by shape (flags vs derived vs context). Don’t treat an “efficiency score” as a product metric.

ui.test.tsx — HUD collapse/expand.

context.test.tsxdebug / showHUD.

Integration and safety

integration.test.tsx — real components through BasisProvider.

engine.test.ts — one write is not a pair; same-frame batching; loop breaker.

safety.test.ts — loop threshold pauses that path.

Integrations

zustand.test.ts — first set() registers; only changed keys pulse; store-vs-local copy; production middleware is a passthrough.

vite.test.tsbasis() looks like a Vite plugin.

Clone this wiki locally