mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
docs: update test template in DEVELOPER.md (#9192)
change to use DataSource instead of Connection
This commit is contained in:
parent
d285fd0a2b
commit
bb33cd0f23
12
DEVELOPER.md
12
DEVELOPER.md
@ -103,21 +103,21 @@ Most tests will benefit from using this template as a starting point:
|
||||
```ts
|
||||
import "reflect-metadata";
|
||||
import { createTestingConnections, closeTestingConnections, reloadTestingDatabases } from "../../utils/test-utils";
|
||||
import { Connection } from "../../../src/connection/Connection";
|
||||
import { DataSource } from "../../../src/data-source/DataSource"
|
||||
import { expect } from "chai";
|
||||
|
||||
describe("github issues > #<issue number> <issue title>", () => {
|
||||
|
||||
let connections: Connection[];
|
||||
before(async () => connections = await createTestingConnections({
|
||||
let dataSources: DataSource[];
|
||||
before(async () => dataSources = await createTestingConnections({
|
||||
entities: [__dirname + "/entity/*{.js,.ts}"],
|
||||
schemaCreate: true,
|
||||
dropSchema: true,
|
||||
}));
|
||||
beforeEach(() => reloadTestingDatabases(connections));
|
||||
after(() => closeTestingConnections(connections));
|
||||
beforeEach(() => reloadTestingDatabases(dataSources));
|
||||
after(() => closeTestingConnections(dataSources));
|
||||
|
||||
it("should <put a detailed description of what it should do here>", () => Promise.all(connections.map(async connection => {
|
||||
it("should <put a detailed description of what it should do here>", () => Promise.all(dataSources.map(async dataSource => {
|
||||
|
||||
// tests go here
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user