Skip to content

Commit

Permalink
clase DB connection
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith committed Feb 10, 2023
1 parent 339c12c commit 236c3bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal_transfers/actions/tests/database.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getDB, hexToBytea, insertSettlementEvent } from "../src/database";
import * as process from "process";
import { sql } from "@databases/pg";
import ConnectionPool from "@databases/pg/lib/ConnectionPool";

// Tried to use their Testing Docs, but it didn't seem quite right
// https://www.atdatabases.org/docs/pg-test
Expand All @@ -14,6 +15,10 @@ describe("insertSettlementEvent(txHash, solver)", () => {
await db.query(sql`TRUNCATE TABLE settlements;`);
});

afterAll(async () => {
await (db as ConnectionPool).dispose();
});

test("Inserts to DB", async () => {
const txHash =
"0x45f52ee09622eac16d0fe27b90a76749019b599c9566f10e21e8d0955a0e428e";
Expand Down

0 comments on commit 236c3bb

Please sign in to comment.