@repo/auth, apps/web, and @repo/database have co-located *.test.{ts,tsx} files. pnpm test (turbo test) runs those three. Setup CLI tests are pnpm test:cli (root vitest.config.mts → scripts/**/*.test.ts) and are not in the turbo graph.
isOrgMember, canManageBilling, authorizeBillingAction — the allow/deny matrix from Billing Authorization across member/admin/owner roles, plus the unknown-action fallback
packages/auth/helpers.test.ts
21
isSubscriptionPendingCancel, isAlreadyCancelingError, isSubscriptionActive across all 8 Stripe subscription statuses, getCurrentPlan, and getStatusDisplayText
packages/auth/admin-bootstrap.test.ts
7
isBootstrapAdminEmail — the ADMIN_EMAILS bootstrap allowlist (case-insensitivity, CSV parsing with spaces, partial-match rejection, empty/undefined list)
TOTP secret rotation — a re-issued secret stays unusable for sign-in until verified, then activates once the user proves possession in session
packages/auth/server-wiring.test.ts
1
The shipped auth instance registers twoFactorAfterHook — the rotation fix is one deletable line in server.ts, and no other test builds the shipped instance
apps/web/lib/routes.test.ts
13
orgRoutes, accountRoutes, resolveCallbackUrl, and the AUTH_ROUTE_PREFIXES/PUBLIC_ROUTE_EXACT/PUBLIC_ROUTE_PREFIXES middleware allowlists