import { describe, it, expect } from 'vitest' import { getDb } from '../src/db/client.js' describe('数据库连接', () => { it('连接本项目 PG(5434)并响应 select 1', async () => { const db = getDb() // postgres.js 驱动下 drizzle 的 execute 返回 RowList(行数组), // 不是 node-postgres 风格的 { rows: [...] },故直接取 r[0] const r = (await db.execute('select 1 as ok')) as any expect(Number(r[0].ok)).toBe(1) }) })