Skip to content

Test harness: vitest, Neon test branch, factories, and test mailer #105

Description

@pataniaeli

Ticket: AUTH-T93 · Epic: E13 Testing & QA · Phase: Phase 0 — Foundation
Priority: High · Estimate: 3 points · Labels: epic:testing, phase:0, testing, infra

Depends on:

Configure vitest (node environment) with a global setup that points Prisma at the Neon test branch (reset from dev before each CI run; runs serialized by a GitHub Actions concurrency group because the 10-branch cap rules out per-run branches), applies migrations, and truncates tables between test files. Provide factories (createUser, createAdmin, createPrimaryAdmin, createSession, createPosition), a fake clock helper, a capturing mailer, and a fake Upstash (in-memory) limiter. Add npm test and coverage thresholds (80% lines on src/lib).

Acceptance criteria

  • npm test runs locally against a personal branch and in CI against the test branch in under 5 minutes.
  • Factories and fakes documented in CONTRIBUTING.md.

Generated from the SGAuth design (docs/sgauth-design in SGAOperations/auth). SGAuth is built on Neon and does not use Supabase.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions