Skip to content

chore: propagate main into development - #57

Merged
Wikid82 merged 3 commits into
developmentfrom
main
Aug 10, 2026
Merged

chore: propagate main into development#57
Wikid82 merged 3 commits into
developmentfrom
main

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR carrying commits pushed directly to main (hotfixes, CI-generated
commits) down into development. nightly is intentionally skipped — it picks
these up via the daily development sync instead.

Triggered by push 4eba452 to main.

Wikid82 and others added 2 commits August 10, 2026 12:06
Adds Vitest + React Testing Library (replacing the node:test runner),
a codecov.yml/GitHub workflow enforcing 85% project+patch coverage,
and a local scripts/check-patch-coverage.mjs + /fix-patch-coverage
command so patch-coverage gaps can be caught before pushing instead
of failing CI. Backfills unit/component tests for the previously
untested action layer, auth/session logic, proxy, and 16 components
to bring real coverage from ~12% to 99.4% lines / 90.6% branches.

Bundles the .github/workflows/ci.yml and codecov.yml workflow changes
into this PR (rather than committing them straight to main per the
usual CI-file convention) because they depend on the accompanying
package.json/vitest.config.ts changes — landing them on main first
would break main's CI until this PR merges down through development.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
## Summary

- Adds Vitest + React Testing Library, replacing the `node:test` runner.
Server/action/lib tests run in plain Node (jose's `Uint8Array` checks
break under jsdom's separate realm); component tests opt into jsdom
per-file via a `// @vitest-environment jsdom` docblock.
- Adds `codecov.yml` + `.github/workflows/codecov.yml` gating project
**and** patch coverage at 85%, mirroring the Charon setup. `ci.yml`'s
test step now runs `npm run test:coverage` so the 85% floor is enforced
even before the Codecov GitHub App/secret are wired up on this repo.
- Adds `scripts/check-patch-coverage.mjs` (`npm run coverage:patch`) — a
dependency-free Node script that diffs `coverage/lcov.info` against a
git baseline to report patch coverage locally, plus
`.claude/commands/fix-patch-coverage.md` (Hestia's equivalent of
Charon's `/fix-patch-coverage`) to close gaps before pushing.
- Backfills real unit/component tests for the previously-untested action
layer (`chores`, `rewards`, `reminders`, `members`, `household`,
`profile`, `auth`), `auth/session.ts`, `auth/current-user.ts`,
`proxy.ts`, and 16 components. Real coverage goes from ~12% to **99.4%
lines / 90.6% branches / 100% functions**.
- Server-logic tests run against a real in-memory SQLite DB (migrated
fresh per test file) with `next/headers`, `next/cache`, and
`next/navigation` mocked in `src/test/setup.ts` — `redirect()` throws
`Error("NEXT_REDIRECT:<path>")`, asserted on directly rather than mocked
away.
- `page.tsx`/`layout.tsx` route entrypoints, `db/schema.ts`,
`db/index.ts`, and `instrumentation.ts` are excluded from the coverage
mandate (thin composition/declarative/bootstrap code, exercised by
`e2e/household-flow.spec.ts` instead) — same ignore list in
`codecov.yml`, `vitest.config.ts`, and the patch-coverage script.

**Note on workflow files:** this PR includes changes to
`.github/workflows/ci.yml` and adds `.github/workflows/codecov.yml`,
rather than committing those straight to `main` per the repo's usual
convention. They depend on the accompanying
`package.json`/`vitest.config.ts` changes in this same PR — landing them
on `main` first would break `main`'s CI until this merges down through
`development`. Flagging this explicitly since it's a deviation from the
documented workflow-files-go-to-main rule.

**Still needed from a maintainer** (can't be done from here): install
the Codecov GitHub App on this repo and add a `CODECOV_TOKEN` repository
secret for `.github/workflows/codecov.yml` to actually upload — until
then, the `codecov` job will fail at the upload step
(tests/coverage/build all still pass regardless).

## Test plan

- [x] `npm run test:coverage` — 172 tests pass, 99.41% lines / 90.61%
branches / 100% functions / 99.09% statements (threshold: 85% lines)
- [x] `npm run lint` — clean
- [x] `npm run build` — clean, TypeScript passes
- [x] `node scripts/check-patch-coverage.mjs` — manually verified it
correctly flags an uncovered synthetic change and correctly reports
clean when reverted
- [ ] Install Codecov GitHub App + add `CODECOV_TOKEN` secret
(maintainer action, see note above)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Wikid82
Wikid82 marked this pull request as ready for review August 10, 2026 18:38
@Wikid82
Wikid82 merged commit 3056d8b into development Aug 10, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants