move postgres to a separate package

This commit is contained in:
dswbx
2025-03-14 09:42:51 +01:00
parent b1b2e97a5a
commit c4aaa5a90b
20 changed files with 381 additions and 80 deletions

View File

@@ -0,0 +1,19 @@
import { describe, it, expect } from "bun:test";
import { PostgresConnection } from "../src";
import { createConnection, cleanDatabase } from "./setup";
describe(PostgresConnection, () => {
it("should connect to the database", async () => {
const connection = createConnection();
expect(await connection.ping()).toBe(true);
});
it("should clean the database", async () => {
const connection = createConnection();
await cleanDatabase(connection);
const tables = await connection.getIntrospector().getTables();
expect(tables).toEqual([]);
});
});