test(website): repair pre-existing red specs + drop Differentiator token stub#490
Merged
Conversation
Drops the 20-line tokens stub. The Hero spec already proves the real design-tokens module loads cleanly under vitest; stubbing it here hid token-shape drift behind invented values. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- docs.spec.ts: contentRoot was built via path.join(process.cwd(), 'apps', 'website', ...), which doubles to apps/website/apps/website/... when the runner is invoked from apps/website/. Switch to a path derived from import.meta.url so it's cwd-invariant. Heals both the MDX-walk crash and the "missing api-docs.json" false negatives (7 libraries flagged as missing files that actually existed). - Delete apps/website/src/components/docs/open-in-cockpit.spec.tsx. The component was removed in 7134a38 (glassy redesign / docs refresh) but its spec was left behind, failing vitest's import resolution and registering as a zero-test failed suite. Result: apps/website vitest goes from 53 passing + 2 failed test files + 1 zero-test load failure to 55 passing across 13 files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Two follow-ups from the homepage refresh PR review.
Repair three pre-existing red specs (
apps/website):src/lib/docs.spec.ts > does not leave tracked MDX docs outside the configured docs inventory— was throwing insidewalkMdxFiles.src/lib/docs.spec.ts > has generated API docs for every documented package surface— was flagging all 7 libraries as missing api-docs.json files that actually exist.src/components/docs/open-in-cockpit.spec.tsx— vitest load failure (0 tests).Root cause for the first two:
const contentRoot = path.join(process.cwd(), 'apps', 'website', 'content', 'docs')doubles toapps/website/apps/website/...when vitest is invoked withapps/website/as cwd (which is exactly how the website's test target runs). Fix is to derive the path fromimport.meta.urlso it's cwd-invariant.Root cause for the third: the source component was deleted in
7134a387(glassy redesign / docs refresh) but the spec was left behind. Removed it.Drop the
@ngaf/design-tokensmock inDifferentiator.spec.tsx. The Hero spec already proves the real module loads cleanly under vitest; stubbing it here was over-stubbing that would hide token-shape drift behind invented values. Tests still pass with the real module.Test plan
cd apps/website && npx vitest run→ 13 files passed, 55 tests passed (was 53 passed + 2 failed files + 1 zero-test load failure).🤖 Generated with Claude Code