Skip to content

test: vitest suite — scales/palette units + a mount regression for #2#8

Merged
ripgrim merged 2 commits into
Boring-Software-Inc:mainfrom
DloomPlz:test/vitest-suite
Jul 13, 2026
Merged

test: vitest suite — scales/palette units + a mount regression for #2#8
ripgrim merged 2 commits into
Boring-Software-Inc:mainfrom
DloomPlz:test/vitest-suite

Conversation

@DloomPlz

Copy link
Copy Markdown
Contributor

What

A zero-config test harness (vitest + happy-dom + @testing-library/react, all devDependencies — no changes to registry sources) with three suites:

  • tests/scales.test.ts — the pure geometry: computeBands across default/stacked/percent (including dirty input coercion and the empty-data guard), buildYScale, the x scales, and pixel hit-testing (nearestIndex, indexAtBand).
  • tests/palette.test.ts — seed shape invariants, rgb() brightness/alpha math, isDitherColor guards.
  • tests/chart-mount.test.tsx — a regression for Infinite "Maximum update depth exceeded" loop in all charts without React Compiler #2: mount AreaChart/PieChart/Sparkline under a compiler-less React with a measured size (the loop only reproduces once the chart is ready) and assert no update-depth loop.

The mount tests are it.skip — deliberately

On current main the #2 loop doesn't fail in a test harness — it hangs the worker (the effect loop keeps the scheduler busy forever), which would hang CI rather than redden it. So they're skipped with instructions in the file: unskip them in the PR that merges #3/#4, at which point they pass and become the permanent regression guard.

Verified both directions locally: suite is green on main as-is (16 passed / 3 skipped, <1s), and with the #3 + #4 patches applied and the skips removed, all 19 pass.

npm test is wired up; happy to add a GitHub Actions workflow on top if you want CI in the same PR.

…nc#2 mount regression

Adds a zero-config test harness (vitest + happy-dom + testing-library):

- tests/scales.test.ts — computeBands (default/stacked/percent, dirty
  input, empty data), buildYScale, x scales and pixel hit-testing.
- tests/palette.test.ts — seed shape, rgb() brightness/alpha, guards.
- tests/chart-mount.test.tsx — the Boring-Software-Inc#2 regression (charts mounting under a
  compiler-less React). Currently it.skip: on unfixed main the effect loop
  HANGS the worker rather than failing, which would hang CI. Unskip in the
  PR that merges Boring-Software-Inc#3/Boring-Software-Inc#4 and it becomes the permanent guard.

npm test runs in <1s; no changes to registry sources.

@tripwire-dev tripwire-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocked by tripwire — the details are in the tripwire comment on this PR.

@tripwire-dev

tripwire-dev Bot commented Jul 13, 2026

Copy link
Copy Markdown

passed — nothing tripped. good to merge.

View on Tripwire

The repo is a registry, not an app — the lockfile was 1,995 of the PR's
2,275 lines for zero consumer value. devDependencies stay declared in
package.json; contributors resolve fresh.
@DloomPlz

Copy link
Copy Markdown
Contributor Author

Slimmed this down: dropped package-lock.json from the PR (and gitignored it) — it was 1,995 of the 2,275 added lines for zero consumer value in a registry repo. The hand-written change is now ~280 lines; suite still green locally (16 passed / 3 skipped, <1s).

Two questions for the tripwire run:

  1. Which rule tripped? The run links in the bot comment point at http://localhost:3000/runs/…, which isn't reachable for contributors — looks like the instance's public base URL might be misconfigured. If the tripped rule was the skipped tests (it.skip on the three mount regressions), that's deliberate and documented in the file: on current main the Infinite "Maximum update depth exceeded" loop in all charts without React Compiler #2 bug hangs the test worker rather than failing, so running them would hang CI — they're meant to be unskipped in the PR that merges fix: stabilize register/unregister callbacks without React Compiler #3/fix: memoize Sparkline's derived rows/config (companion to #3, closes the rest of #2) #4. Happy to restructure (e.g. behind an env flag) if the rule can't be waived.
  2. If it was diff size / lockfile, the push above should clear it on re-run.

@ripgrim ripgrim merged commit b8a0c76 into Boring-Software-Inc:main Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants