UNPKG

@cocalc/database

Version:

CoCalc: code for working with our PostgreSQL database

17 lines 715 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const pg_type_1 = require("./pg-type"); test("pgType throws error on invalid input type", () => { expect(() => (0, pg_type_1.pgType)(null)).toThrow(); }); test("pgType returns pg_type field as is", () => { expect((0, pg_type_1.pgType)({ pg_type: "fubar" })).toBe("fubar"); }); test("pgType requires pg_type or type to be specified", () => { expect(() => (0, pg_type_1.pgType)({})).toThrow(); }); test("pgType translates some types properly", () => { expect((0, pg_type_1.pgType)({ type: "uuid" })).toBe("UUID"); expect((0, pg_type_1.pgType)({ type: "map" })).toBe("JSONB"); }); //# sourceMappingURL=pg-type.test.js.map