From 178838e06ccac481de8d8794ff42bee668a069a4 Mon Sep 17 00:00:00 2001 From: dswbx Date: Fri, 14 Mar 2025 09:55:00 +0100 Subject: [PATCH] remove postgres test from main package --- app/__test__/data/specs/connection/pg.spec.ts | 60 ------------------- packages/postgres/package.json | 2 +- 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 app/__test__/data/specs/connection/pg.spec.ts diff --git a/app/__test__/data/specs/connection/pg.spec.ts b/app/__test__/data/specs/connection/pg.spec.ts deleted file mode 100644 index 015272d..0000000 --- a/app/__test__/data/specs/connection/pg.spec.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { describe, expect, test } from "bun:test"; -import { createApp } from "App"; -import { PostgresConnection } from "data/connection/postgres/PostgresConnection"; -import * as proto from "data/prototype"; -import { PostgresIntrospector } from "data/connection/postgres/PostgresIntrospector"; -import { ParseJSONResultsPlugin } from "kysely"; - -const connection = new PostgresConnection({ - database: "test", - host: "localhost", - user: "root", - password: "1234", - port: 5433, -}); - -const ALL_TESTS = !!process.env.ALL_TESTS; - -describe.skipIf(ALL_TESTS)("postgres", () => { - test.skip("introspector", async () => { - const introspector = new PostgresIntrospector(connection.kysely, { - plugins: [new ParseJSONResultsPlugin()], - }); - - console.log(await introspector.getSchemaSpec()); - }); - - test("builds", async () => { - const schema = proto.em( - { - posts: proto.entity("posts", { - title: proto.text().required(), - }), - comments: proto.entity("comments", { - text: proto.text(), - }), - }, - (ctx, s) => { - ctx.relation(s.comments).manyToOne(s.posts); - ctx.index(s.posts).on(["title"], true); - ctx.index(s.comments).on(["text"]); - }, - ); - - const app = createApp({ - initialConfig: { - data: schema.toJSON(), - }, - connection, - }); - - await app.build({ sync: true }); - - /*await app.em - .mutator("posts") - .insertMany([{ title: "hello world" }, { title: "hello world 2" }]);*/ - - expect(app.version()).toBeDefined(); - console.log(await app.em.repo("posts").findMany()); - }); -}); diff --git a/packages/postgres/package.json b/packages/postgres/package.json index 7f1247e..51d0e90 100644 --- a/packages/postgres/package.json +++ b/packages/postgres/package.json @@ -33,5 +33,5 @@ "metafile": true, "external": ["bknd", "pg", "kysely"] }, - "files": ["dist", "!*.map", "!metafile*.json"] + "files": ["dist", "README.md", "!*.map", "!metafile*.json"] }