feat: introduce DummyConnection class for testing purposes

This commit is contained in:
dswbx
2025-09-21 14:20:07 +02:00
parent 99c1645411
commit 5e62e681e7
2 changed files with 14 additions and 3 deletions
@@ -1,7 +1,7 @@
import { describe, it, expect } from "bun:test";
import { EntityTypescript } from "./EntityTypescript";
import * as proto from "../prototype";
import { getDummyConnection } from "../../../__test__/data/helper";
import { DummyConnection } from "../connection/Connection";
describe("EntityTypescript", () => {
it("should generate correct typescript for system entities", () => {
@@ -18,8 +18,7 @@ describe("EntityTypescript", () => {
relation(test).manyToOne(users);
},
);
const { dummyConnection } = getDummyConnection();
const et = new EntityTypescript(schema.proto.withConnection(dummyConnection));
const et = new EntityTypescript(schema.proto.withConnection(new DummyConnection()));
expect(et.toString()).toContain('users?: DB["users"];');
});
});