import { readFileSync } from "node:fs"; import { resolve } from "node:path"; import { describe, expect, it } from "vitest"; const migration = readFileSync( resolve(process.cwd(), "drizzle/0036_broken_rattler.sql"), "utf8", ); describe("webImportSources migration", () => { it("peut être appliquée sans échec si la table a déjà été créée", () => { expect(migration).toMatch(/CREATE TABLE IF NOT EXISTS `webImportSources`/); }); it("définit les colonnes nécessaires au connecteur sans modifier les factures", () => { expect(migration).toContain("`portalUrl` varchar(500) NOT NULL"); expect(migration).toContain("`loginPassword` text NOT NULL"); expect(migration).toContain("`apiToken` varchar(128) NOT NULL"); expect(migration).not.toContain("invoices"); }); });