Skip to content

Commit

Permalink
chore: remove uneccessary cockroachdriver calls in view-entity tests (#…
Browse files Browse the repository at this point in the history
…6587)

this is a backport of changes from the `next` branch
  • Loading branch information
imnotjames committed Aug 19, 2020
1 parent 10d0aea commit 5a9150e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 25 deletions.
7 changes: 2 additions & 5 deletions test/functional/view-entity/mssql/view-entity-mssql.ts
@@ -1,6 +1,5 @@
import {expect} from "chai";
import "reflect-metadata";
import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver";
import {Category} from "./entity/Category";
import {Connection} from "../../../../src";
import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils";
Expand Down Expand Up @@ -49,13 +48,11 @@ describe("view entity > mssql", () => {
const postCategories = await connection.manager.find(PostCategory);
postCategories.length.should.be.equal(2);

const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1;
postCategories[0].id.should.be.equal(postId1);
postCategories[0].id.should.be.equal(1);
postCategories[0].postName.should.be.equal("About BMW");
postCategories[0].categoryName.should.be.equal("Cars");

const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2;
postCategories[1].id.should.be.equal(postId2);
postCategories[1].id.should.be.equal(2);
postCategories[1].postName.should.be.equal("About Boeing");
postCategories[1].categoryName.should.be.equal("Airplanes");

Expand Down
7 changes: 2 additions & 5 deletions test/functional/view-entity/mysql/view-entity-mysql.ts
@@ -1,6 +1,5 @@
import {expect} from "chai";
import "reflect-metadata";
import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver";
import {Category} from "./entity/Category";
import {Connection} from "../../../../src";
import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils";
Expand Down Expand Up @@ -49,13 +48,11 @@ describe("view entity > mysql", () => {
const postCategories = await connection.manager.find(PostCategory);
postCategories.length.should.be.equal(2);

const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1;
postCategories[0].id.should.be.equal(postId1);
postCategories[0].id.should.be.equal(1);
postCategories[0].postName.should.be.equal("About BMW");
postCategories[0].categoryName.should.be.equal("Cars");

const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2;
postCategories[1].id.should.be.equal(postId2);
postCategories[1].id.should.be.equal(2);
postCategories[1].postName.should.be.equal("About Boeing");
postCategories[1].categoryName.should.be.equal("Airplanes");

Expand Down
7 changes: 2 additions & 5 deletions test/functional/view-entity/oracle/view-entity-oracle.ts
@@ -1,6 +1,5 @@
import {expect} from "chai";
import "reflect-metadata";
import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver";
import {Category} from "./entity/Category";
import {Connection} from "../../../../src";
import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils";
Expand Down Expand Up @@ -49,13 +48,11 @@ describe("view entity > oracle", () => {
const postCategories = await connection.manager.find(PostCategory);
postCategories.length.should.be.equal(2);

const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1;
postCategories[0].id.should.be.equal(postId1);
postCategories[0].id.should.be.equal(1);
postCategories[0].postName.should.be.equal("About BMW");
postCategories[0].categoryName.should.be.equal("Cars");

const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2;
postCategories[1].id.should.be.equal(postId2);
postCategories[1].id.should.be.equal(2);
postCategories[1].postName.should.be.equal("About Boeing");
postCategories[1].categoryName.should.be.equal("Airplanes");

Expand Down
7 changes: 2 additions & 5 deletions test/functional/view-entity/postgres/view-entity-postgres.ts
@@ -1,6 +1,5 @@
import {expect} from "chai";
import "reflect-metadata";
import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver";
import {Category} from "./entity/Category";
import {Connection} from "../../../../src";
import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils";
Expand Down Expand Up @@ -75,13 +74,11 @@ describe("view entity > postgres", () => {
const postCategories = await connection.manager.find(PostCategory);
postCategories.length.should.be.equal(2);

const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1;
postCategories[0].id.should.be.equal(postId1);
postCategories[0].id.should.be.equal(1);
postCategories[0].postName.should.be.equal("About BMW");
postCategories[0].categoryName.should.be.equal("Cars");

const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2;
postCategories[1].id.should.be.equal(postId2);
postCategories[1].id.should.be.equal(2);
postCategories[1].postName.should.be.equal("About Boeing");
postCategories[1].categoryName.should.be.equal("Airplanes");

Expand Down
7 changes: 2 additions & 5 deletions test/functional/view-entity/sqlite/view-entity-sqlite.ts
@@ -1,6 +1,5 @@
import {expect} from "chai";
import "reflect-metadata";
import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver";
import {Category} from "./entity/Category";
import {Connection} from "../../../../src";
import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils";
Expand Down Expand Up @@ -49,13 +48,11 @@ describe("view entity > sqlite", () => {
const postCategories = await connection.manager.find(PostCategory);
postCategories.length.should.be.equal(2);

const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1;
postCategories[0].id.should.be.equal(postId1);
postCategories[0].id.should.be.equal(1);
postCategories[0].postName.should.be.equal("About BMW");
postCategories[0].categoryName.should.be.equal("Cars");

const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2;
postCategories[1].id.should.be.equal(postId2);
postCategories[1].id.should.be.equal(2);
postCategories[1].postName.should.be.equal("About Boeing");
postCategories[1].categoryName.should.be.equal("Airplanes");

Expand Down

0 comments on commit 5a9150e

Please sign in to comment.