Skip to content

docs(testing): audit vitest 4 patterns + add testing-vitest.md - #249

Merged
h4yfans merged 1 commit into
mainfrom
debt/phase-6-u4-vitest-audit
Apr 16, 2026
Merged

docs(testing): audit vitest 4 patterns + add testing-vitest.md#249
h4yfans merged 1 commit into
mainfrom
debt/phase-6-u4-vitest-audit

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Part of Phase 6 Tech Debt Remediation — see .claude/plans/tech-debt-remediation.md § 6.4.

Summary

New docs/testing-vitest.md documenting the current Vitest 4 baseline.

Audit findings: zero v3-era deprecated patterns across the test suite. pnpm test output emits no deprecation warnings. No code changes needed — the migration to Vitest 4 is clean.

What the doc covers

  • Current versions (desktop: "4", sync-server: "^4.0.0")
  • 3-project layout (shared/main/renderer) in vitest.config.ts
  • Coverage ratchet pinned at 37/28/34/38 (baseline 2026-04-15); terminal target 80/70/75/80
  • Audit table — legacy patterns grepped, all came back clean
  • Idioms in use (with real file citations):
    • vi.mock(path, () => ({ default: { ... } })) for default-export mocks
    • vi.fn<typeof fetch>() for typed mocks
    • vi.mocked(foo) for reasserting types on already-mocked modules
  • File layout convention (tests live next to source; shared fixtures in tests/utils/fixtures/ per Phase 3.3)
  • Known gotchas: Zod v4 record, better-sqlite3 ERR_DLOPEN_FAILED symptom

Test plan

  • pnpm test 2>&1 | grep -iE 'deprecated|will be removed' returns 0 hits
  • Doc-only PR; CI green on default workflows

Documents the current Vitest 4 baseline for the memry test suite:
- Current versions across workspaces
- 3-project layout (shared/main/renderer) from vitest.config.ts
- Coverage ratchet pinned at 37/28/34/38 (baseline 2026-04-15)
- Audit findings: zero v3-era deprecated patterns found
- Idioms in use (default-export mocks, typed vi.fn, jsdom renderer setup)
- File layout conventions (tests/utils/fixtures/ placement, Phase 3.3)
- Known gotchas (Zod v4 record, better-sqlite3 ABI, pre-existing errors)

No code changes needed — audit came back clean.

Plan: .claude/plans/tech-debt-remediation.md § 6.4
@h4yfans
h4yfans merged commit 6eae43b into main Apr 16, 2026
2 checks passed
@h4yfans
h4yfans deleted the debt/phase-6-u4-vitest-audit branch April 16, 2026 22:21
h4yfans added a commit that referenced this pull request May 6, 2026
Documents the current Vitest 4 baseline for the memry test suite:
- Current versions across workspaces
- 3-project layout (shared/main/renderer) from vitest.config.ts
- Coverage ratchet pinned at 37/28/34/38 (baseline 2026-04-15)
- Audit findings: zero v3-era deprecated patterns found
- Idioms in use (default-export mocks, typed vi.fn, jsdom renderer setup)
- File layout conventions (tests/utils/fixtures/ placement, Phase 3.3)
- Known gotchas (Zod v4 record, better-sqlite3 ABI, pre-existing errors)

No code changes needed — audit came back clean.

Plan: .claude/plans/tech-debt-remediation.md § 6.4
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.

1 participant