11 lines
622 B
TypeScript
11 lines
622 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { productionConnections } from "../src/runtime-connections.ts";
|
|
|
|
test("deployment connections override build placeholders without accepting server settings", () => {
|
|
const db = { driver: "postgres", url: "postgres://runtime:secret@db/app" };
|
|
expect(productionConnections(JSON.stringify({ db, realtime: { scale: true } }))).toEqual({ db, realtime: { scale: true } });
|
|
expect(productionConnections("")).toEqual({});
|
|
for (const value of ["null", "[]", "invalid", '{"port":80}', '{"db":null}', '{"db":[]}'])
|
|
expect(() => productionConnections(value)).toThrow();
|
|
});
|