test: vitest suite — scales/palette units + a mount regression for #2#8
Merged
Merged
Conversation
…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.
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.
Contributor
Author
|
Slimmed this down: dropped Two questions for the tripwire run:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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:computeBandsacrossdefault/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,isDitherColorguards.tests/chart-mount.test.tsx— a regression for Infinite "Maximum update depth exceeded" loop in all charts without React Compiler #2: mountAreaChart/PieChart/Sparklineunder a compiler-less React with a measured size (the loop only reproduces once the chart isready) and assert no update-depth loop.The mount tests are
it.skip— deliberatelyOn current
mainthe #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
mainas-is (16 passed / 3 skipped, <1s), and with the #3 + #4 patches applied and the skips removed, all 19 pass.npm testis wired up; happy to add a GitHub Actions workflow on top if you want CI in the same PR.