import { describe, it, expect, beforeAll } from 'vitest'; import { resetDb, withClient } from '../helpers/db.js'; import { migrateUp } from '../../lib/db/migrate.js'; describe('migration 006 — audit', () => { beforeAll(async () => { await resetDb(); await migrateUp(); }); it('creates audit_log and pending_changes', async () => { await withClient(async (c) => { for (const t of ['audit_log','pending_changes']) { const { rows } = await c.query(`SELECT to_regclass('public.' || $1) AS t;`, [t]); expect(rows[0].t).toBe(t); } }); }); });