Repository navigation
fix(test): revert the scf-core un-exclude — the suite still cannot exit clean (#504, #593) - #606
Merged
Merged
Conversation
…it clean (#504, #593) I un-excluded scf-core from test:unit in #604 on the strength of a JSON report showing 957 passed / 0 failed. That was the wrong signal. `vitest run` exits 1 regardless, so `pnpm test` went red on main for anyone running it locally. Two things were wrong with how I checked. The OOM is real. I grepped the background task's output file for "heap out of memory" and got nothing, because that file held only my own echo lines — vitest's stderr went elsewhere and I never read it. #504 is not stale: at --max-old-space-size=4096 the main process dies with "Ineffective mark-compacts near heap limit" at ~4GB. Raising it to 8192 does not fix it either; with the two collection failures below repaired, more files collect, more memory is retained, and it OOMs again at 8GB. Every test passes and the report says success: true — the failure is entirely the parent process at teardown, not the tests. My pass/fail summary could not see a broken file. A file that fails to *collect* contributes zero passed and zero failed, so it is invisible to a count of assertions. Two files were failing that way and I shipped both: - ScaffaldLogo.test.tsx (mine, #599) — "Unexpected token 'typeof'". react-native-svg's untransformed source. A mock for it has existed at tests/infrastructure/vitest/mocks/react-native-svg.tsx since it was written but was never aliased in vitest.config.ts, unlike the react-native, lucide and expo-updates mocks. Now aliased, which fixes any test rendering an SVG. - ProfileWizard.test.tsx (mine, #605) — the commit hook I added pulled @scf/core/provider, and through it UniversalThemeProvider -> expo-router/react-navigation, which does not resolve under vitest. Mocked in the test; the commit path keeps its own unit tests. The logo test also asserted something false: that two separate render() calls produce byte-identical markup. They are two React roots, and useId is only required to be deterministic by position within a root, so a correct implementation fails that. It now asserts what actually regresses if the id goes random again — not drawn from a random source, stable across re-renders, distinct between two logos in one tree, and referenced by the url(#id) that fills the mark. scf-core goes back in the exclude list. Making it runnable is #504's job and it needs the parent-process retention fixed, not a bigger ceiling. Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Aug 12, 2026
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.
Reverts the
test:unitchange from #604 and repairs two test files I broke. Corrects the record on #504 and #593.What I got wrong
I un-excluded
scf-corefromtest:uniton the strength of a JSON report showing 957 passed / 0 failed. That was the wrong signal:vitest runexits 1 regardless, sopnpm testhas been red onmainfor anyone running it locally since #604 merged.The OOM is real — #504 is not stale. I grepped the background task's output file for "heap out of memory" and got nothing, because that file held only my own
echolines; vitest's stderr went elsewhere and I never read it. At--max-old-space-size=4096the main process dies with "Ineffective mark-compacts near heap limit" at ~4GB.Raising it to 8192 does not fix it either. With the two collection failures below repaired, more files collect, more is retained, and it OOMs again at 8GB:
successEvery test passes and the report says
success: true. The failure is entirely the parent process at teardown. That is #504's actual subject, and it needs the retention fixed — not a bigger ceiling.A file that fails to collect is invisible to a pass/fail count
This is the process error worth keeping. A file that fails to collect contributes zero passed and zero failed, so summing assertions cannot see it. Two files were failing that way and I shipped both — my own, from #599 and #605:
ScaffaldLogo.test.tsx—Unexpected token 'typeof', react-native-svg's untransformed source. A mock has existed attests/infrastructure/vitest/mocks/react-native-svg.tsxsince it was written but was never aliased invitest.config.ts, unlike thereact-native,lucide-react-nativeandexpo-updatesmocks sitting beside it. Now aliased — which fixes any test rendering an SVG, not just this one.ProfileWizard.test.tsx— the commit hook added in feat(profile): make the guided wizard reachable, and have it write a real profile (#584) #605 pulled@scf/core/provider, and through itUniversalThemeProvider→expo-router/react-navigation, which does not resolve under vitest. Mocked in the test; the commit path keeps its own unit tests.The logo test also asserted something false
It claimed two separate
render()calls produce byte-identical markup. They are two React roots, anduseIdis only required to be deterministic by position within a root — so a correct implementation fails that assertion. Replaced with what actually regresses if the id goes random again:Math.random().toString(36)shape)url(#id)that fills the mark6 assertions, all passing, and they now fail for the right reason.
Net effect
pnpm testis green again.scf-coreis back in the exclude list, so #593 is not closed by #604 — reopened with the memory evidence above.🤖 Generated with Claude Code