テストがうごかないのを修正 (#7566)
* startServer * typeorm 0.2.32 * Fix: chartのテストがテストの並び順によっては正しく初期化されない * initTestDb
This commit is contained in:
10
test/note.ts
10
test/note.ts
@ -12,9 +12,8 @@ process.env.NODE_ENV = 'test';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as childProcess from 'child_process';
|
||||
import { async, signup, request, post, uploadFile, launchServer, shutdownServer } from './utils';
|
||||
import { async, signup, request, post, uploadFile, startServer, shutdownServer, initTestDb } from './utils';
|
||||
import { Note } from '../src/models/entities/note';
|
||||
import { initDb } from '../src/db/postgre';
|
||||
|
||||
describe('Note', () => {
|
||||
let p: childProcess.ChildProcess;
|
||||
@ -23,12 +22,13 @@ describe('Note', () => {
|
||||
let alice: any;
|
||||
let bob: any;
|
||||
|
||||
before(launchServer(g => p = g, async () => {
|
||||
const connection = await initDb(true);
|
||||
before(async () => {
|
||||
p = await startServer();
|
||||
const connection = await initTestDb(true);
|
||||
Notes = connection.getRepository(Note);
|
||||
alice = await signup({ username: 'alice' });
|
||||
bob = await signup({ username: 'bob' });
|
||||
}));
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await shutdownServer(p);
|
||||
|
Reference in New Issue
Block a user