Skip to content

Commit

Permalink
wip test
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Feb 14, 2024
1 parent 464f94d commit 494d360
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/tests/pgbouncer.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import test from "ava"
import { QueryResult } from "pg"
import { getTestPostgresDatabaseFactory } from "~/index"

test("works with multiple versions", async (t) => {
const getPostgres13 = getTestPostgresDatabaseFactory({
postgresVersion: "13.5",
})

const postgres13 = await getPostgres13(t)

const parseVersion = (result: QueryResult) => {
const {
rows: [{ version }],
} = result
return version.split(" ")[1]
}

t.is(parseVersion(await postgres13.pool.query("SELECT version()")), "13.5")
t.is(parseVersion(await postgres14.pool.query("SELECT version()")), "14.5")

Check failure on line 20 in src/tests/pgbouncer.test.ts

View workflow job for this annotation

GitHub Actions / Check types

Cannot find name 'postgres14'. Did you mean 'postgres13'?
})

0 comments on commit 494d360

Please sign in to comment.