一回一回コネクションを閉じる
This commit is contained in:
parent
273e090d3f
commit
56e35cf4f8
|
@ -19,17 +19,20 @@ import * as childProcess from 'child_process';
|
||||||
import { connectStream, signup, request, post, launchServer } from './utils';
|
import { connectStream, signup, request, post, launchServer } from './utils';
|
||||||
import { Following } from '../src/models/entities/following';
|
import { Following } from '../src/models/entities/following';
|
||||||
import { initDb } from '../src/db/postgre';
|
import { initDb } from '../src/db/postgre';
|
||||||
|
import { Connection } from 'typeorm';
|
||||||
|
|
||||||
describe('Streaming', () => {
|
describe('Streaming', () => {
|
||||||
let p: childProcess.ChildProcess;
|
let p: childProcess.ChildProcess;
|
||||||
let Followings: any;
|
let Followings: any;
|
||||||
|
let connection: Connection;
|
||||||
|
|
||||||
beforeEach(launchServer(g => p = g, async () => {
|
beforeEach(launchServer(g => p = g, async () => {
|
||||||
const connection = await initDb(true);
|
connection = await initDb(true);
|
||||||
Followings = connection.getRepository(Following);
|
Followings = connection.getRepository(Following);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
connection.close();
|
||||||
p.kill();
|
p.kill();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue