Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(helpers): pass client instead of pool; fix typing #379

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -1,4 +1,4 @@
import { makeWithPgClientViaPgClientAlreadyInTransaction } from "@dataplan/pg/adaptors/pg";

Check failure on line 1 in @app/server/__tests__/helpers.ts

View workflow job for this annotation

GitHub Actions / build

Unable to resolve path to module '@dataplan/pg/adaptors/pg'

Check failure on line 1 in @app/server/__tests__/helpers.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unable to resolve path to module '@dataplan/pg/adaptors/pg'
import { execute, hookArgs } from "grafast";
import {
ExecutionArgs,
Expand All @@ -25,8 +25,8 @@
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
Loading