Files
aisubsidy/vitest.config.mts
pkgsp50777_楊舒諠andClaude Opus 5.5 5b43dd192b
CI / check (push) Successful in 14m27s
CI / e2e (push) Successful in 16m16s
add-identity-and-access: Authentik login, roles, org admin
- Company login via Authentik OIDC (openid-client, PKCE/state/nonce,
  employee_number scope); AUTH_MODE=dev alternative login at
  /login/dev, refused at startup when platform OIDC_ISSUER is present
- provisionOnLogin: accounts created on first login (employee role,
  pending department), inactive accounts rejected, bootstrap sysadmins
- DB sessions (hashed tokens, 8h idle timeout, revoked on deactivate)
- Authorization: ROUTE_RULES + requireRouteAccess/requireRole per page
  and action, forbidden() 403 page, proxy.ts cookie redirect,
  scopeApplications/canReview/requireDepartment, role-based navigation
- Admin: departments (code, type, deactivate, managers), accounts
  (pending filter, department assignment with effective date, roles,
  deactivate), roster CSV import with two-phase preview/commit
- departmentMembersAt for headcount snapshots
- Tests: 168 unit/integration (incl. mock OIDC provider), 12 e2e
- CI: e2e job; CLAUDE.md: auth rules and commands

Tasks 15/17 done. Pending: 5.1 (confirm CI run once a remote exists),
5.3 (manual verification with real Authentik after first deploy).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 17:36:11 +08:00

16 lines
428 B
TypeScript

import { defineConfig } from "vitest/config";
export default defineConfig({
resolve: { tsconfigPaths: true },
test: {
environment: "node",
include: ["src/**/*.test.{ts,tsx}", "scripts/**/*.test.ts"],
// 測試不讀 .env;需要的環境變數在這裡給固定值。
env: {
SESSION_SECRET: "test-session-secret-0123456789abcdef",
AUTH_MODE: "dev",
TZ_APP: "Asia/Taipei",
},
},
});