Compare commits

...

1 Commits

Author SHA1 Message Date
Ciro Spaciari
991da53eb7 add tests but need to configure local db too 2024-11-11 11:38:43 -08:00
8 changed files with 2519 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "postgres",
"dependencies": {
"postgres": "3.3.5",
"postgres": "3.4.5",
"pg-connection-string": "2.6.1"
}
}

View File

@@ -0,0 +1,2 @@
1 2 3
4 5 6
1 1 2 3
2 4 5 6

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
select $1 as x

View File

@@ -0,0 +1 @@
select 1 as x

View File

@@ -0,0 +1,16 @@
import { test as bunTest, expect } from "bun:test";
export const t = (...rest) => test(...rest);
t.timeout = 5;
async function test(name, options, fn) {
typeof options !== "object" && ((fn = options), (options = {}));
bunTest(
name,
async () => {
const [expected, got] = await fn();
expect(expected).toBe(got);
},
(options.timeout || t.timeout) * 1000,
);
}

View File

@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
import { getSecret } from "harness";
import postgres from "postgres";
const databaseUrl = getSecret("TLS_POSTGRES_DATABASE_URL");
const databaseUrl = getSecret("TLS_POSTGRES_DATABASE_URL") as string;
describe.skipIf(!databaseUrl)("postgres", () => {
test("should connect using TLS", async () => {

View File

@@ -43,7 +43,7 @@
"pg-connection-string": "2.6.1",
"pino": "9.4.0",
"pino-pretty": "11.2.2",
"postgres": "3.3.5",
"postgres": "3.4.5",
"prisma": "5.1.1",
"prompts": "2.4.2",
"reflect-metadata": "0.1.13",