Add test infrastructure for hydrators using node:test
- Add docker-compose.test.yml with isolated PostgreSQL on port 5433 - Add environment variable support for database connection config - Add test setup utilities and initial user hydrator tests - Add test and test:watch scripts to package.json Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,13 +21,13 @@ import type { SessionData, TokenId } from "./auth/types";
|
||||
import type { Domain } from "./types";
|
||||
import { AuthenticatedUser, type User, type UserId } from "./user";
|
||||
|
||||
// Connection configuration
|
||||
// Connection configuration (supports environment variable overrides)
|
||||
const connectionConfig = {
|
||||
host: "localhost",
|
||||
port: 5432,
|
||||
user: "diachron",
|
||||
password: "diachron",
|
||||
database: "diachron",
|
||||
host: process.env.DB_HOST ?? "localhost",
|
||||
port: Number(process.env.DB_PORT ?? 5432),
|
||||
user: process.env.DB_USER ?? "diachron",
|
||||
password: process.env.DB_PASSWORD ?? "diachron",
|
||||
database: process.env.DB_NAME ?? "diachron",
|
||||
};
|
||||
|
||||
// Database schema types for Kysely
|
||||
|
||||
Reference in New Issue
Block a user