Skip to content

Commit

Permalink
SchemaTransformer requires a connection now
Browse files Browse the repository at this point in the history
  • Loading branch information
imnotjames committed Sep 15, 2020
1 parent d2201ab commit cbfbc56
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/github-issues/5444/issue-5444.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,29 @@ import {expect} from "chai";

import { Post, PostSchema } from "./entity/Post";
import { Author, AuthorSchema } from "./entity/Author";
import {EntitySchema} from "../../../src";
import {Connection, EntitySchema} from "../../../src";
import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../utils/test-utils.js";


describe("github issues > #5444 EntitySchema missing support for multiple joinColumns in relations", () => {
it("Update query returns the number of affected rows", async () => {
let connections: Connection[];

before(async () => {
return connections = await createTestingConnections({
entities: [Post, Author],
schemaCreate: true,
dropSchema: true,
enabledDrivers: ["sqlite"]
});
});
beforeEach(() => reloadTestingDatabases(connections));
after(() => closeTestingConnections(connections));

it("Update query returns the number of affected rows", async () => Promise.all(connections.map(async (connection) => {
const transformer = new EntitySchemaTransformer();

const actual = transformer.transform(
connection,
[
new EntitySchema<Author>(AuthorSchema),
new EntitySchema<Post>(PostSchema)
Expand All @@ -36,5 +51,5 @@ describe("github issues > #5444 EntitySchema missing support for multiple joinCo
},

]);
});
})));
});

0 comments on commit cbfbc56

Please sign in to comment.