23 lines
622 B
TypeScript
23 lines
622 B
TypeScript
import { assertArrayIncludes, assertEquals } from "std/assert/mod.ts";
|
|
import { afterAll, describe, it } from "std/testing/bdd.ts";
|
|
|
|
import { PostgresTestContainer } from "../containers/postgres.ts";
|
|
|
|
const DB_NAME = "sandbox";
|
|
|
|
const container = await PostgresTestContainer.start("postgres:14");
|
|
await container.create(DB_NAME);
|
|
|
|
const sql = await container.client(DB_NAME);
|
|
|
|
describe("Postgres", () => {
|
|
afterAll(async () => {
|
|
await container.stop();
|
|
});
|
|
|
|
it("should spin up a postgres container", async () => {
|
|
const res = await sql`SELECT 1`;
|
|
assertArrayIncludes(res, [{ "?column?": 1 }]);
|
|
});
|
|
});
|