feat: initial commit
This commit is contained in:
22
tests/postgres.test.ts
Normal file
22
tests/postgres.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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 }]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user