Prisma models per data-model.md: users (status enum, site-admin flag), user_identities (password provider now, OIDC later — subject is the stable user id), sessions (hashed ids), auth_tokens (hashed, single- use), plus rate_limits and mail_outbox for the upcoming M1 stories. UsersService creates accounts transactionally with Argon2id-hashed password identities (OWASP parameters, rehash detection) and maps uniqueness violations to field-level conflicts. Database-backed suites run when TEST_DATABASE_URL is set — locally against the dev db, in CI via a new postgres service container; shared auth schemas (username, password policy incl. common-password blocklist) ship with tests. Closes #10 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
15 lines
486 B
TypeScript
15 lines
486 B
TypeScript
import swc from 'unplugin-swc';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
// NestJS relies on decorator metadata, which esbuild (Vitest's default
|
|
// transformer) cannot emit — SWC (configured via .swcrc) can.
|
|
export default defineConfig({
|
|
plugins: [swc.vite({ module: { type: 'es6' } })],
|
|
test: {
|
|
environment: 'node',
|
|
globalSetup: './vitest.global-setup.ts',
|
|
// DB-backed suites share one database; parallel files would race.
|
|
fileParallelism: false,
|
|
},
|
|
});
|