diff options
author | 2023-10-17 14:10:25 -0700 | |
---|---|---|
committer | 2023-10-17 14:10:25 -0700 | |
commit | 7458b969c5d9971e89d187b687e1924e78da427e (patch) | |
tree | ee3dbf95c728cf407bf49a27826b541e9264a8bd /test/js/third_party/postgres/postgres.test.ts | |
parent | d4a2c29131ec154f5e4db897d4deedab2002cbc4 (diff) | |
parent | e91436e5248d947b50f90b4a7402690be8a41f39 (diff) | |
download | bun-7458b969c5d9971e89d187b687e1924e78da427e.tar.gz bun-7458b969c5d9971e89d187b687e1924e78da427e.tar.zst bun-7458b969c5d9971e89d187b687e1924e78da427e.zip |
Merge branch 'main' into postinstall_3
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", () => { |