Skip to content

Commit

Permalink
test(helpers): pass client instead of pool; fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
bchrobot committed Apr 23, 2024
1 parent 014b24b commit 0c5df5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion @app/__tests__/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Pool, PoolClient } from "pg";

const pools = {};
const pools: { [key: string]: Pool } = {};

if (!process.env.TEST_DATABASE_URL) {
throw new Error("Cannot run tests without a TEST_DATABASE_URL");
Expand Down
4 changes: 2 additions & 2 deletions @app/server/__tests__/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export async function createUserAndLogIn() {
const pool = poolFromUrl(process.env.TEST_DATABASE_URL!);
const client = await pool.connect();
try {
const [user] = await createUsers(pool, 1, true);
const session = await createSession(pool, user.id);
const [user] = await createUsers(client, 1, true);
const session = await createSession(client, user.id);
return { user, session };
} finally {
client.release();
Expand Down

0 comments on commit 0c5df5f

Please sign in to comment.