()
| 28 | // Lazily create a Prisma client so DATABASE_URL is read at call time, |
| 29 | // not at module-import time (globalSetup runs before env is configured). |
| 30 | function getDb() { |
| 31 | const url = |
| 32 | process.env.DATABASE_URL ?? |
| 33 | 'postgresql://postgres:postgres@localhost:5432/postgres?schema=public'; |
| 34 | return new PrismaClient({ datasources: { db: { url } } }); |
| 35 | } |
| 36 | |
| 37 | // --------------------------------------------------------------------------- |
| 38 | // Well-known fixture IDs — import these in tests instead of hard-coding strings |
no outgoing calls
no test coverage detected