diff options
Diffstat (limited to 'test/js/third_party/postgres/postgres.test.ts')
-rw-r--r-- | test/js/third_party/postgres/postgres.test.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/js/third_party/postgres/postgres.test.ts b/test/js/third_party/postgres/postgres.test.ts index 758fee778..991c85d88 100644 --- a/test/js/third_party/postgres/postgres.test.ts +++ b/test/js/third_party/postgres/postgres.test.ts @@ -1,5 +1,5 @@ import { test, expect, describe } from "bun:test"; -import { Pool } from "pg"; +import { Pool, Client } from "pg"; import { parse } from "pg-connection-string"; import postgres from "postgres"; @@ -19,6 +19,18 @@ describe("pg", () => { pool.end(); } }); + + it("should execute big query and end connection", async () => { + const client = new Client({ + connectionString: CONNECTION_STRING, + ssl: { rejectUnauthorized: false }, + }); + + await client.connect(); + const res = await client.query(`SELECT * FROM users LIMIT 1000`); + expect(res.rows.length).toBeGreaterThanOrEqual(300); + await client.end(); + }, 5000); }); describe("postgres", () => { |