Wait shutdown in test

This commit is contained in:
mei23
2021-06-04 20:56:19 +09:00
parent 79c33ab536
commit 8a9f736cde
6 changed files with 32 additions and 15 deletions

View File

@@ -12,7 +12,7 @@ process.env.NODE_ENV = 'test';
import * as assert from 'assert';
import * as childProcess from 'child_process';
import { async, signup, request, post, uploadFile, launchServer } from './utils';
import { async, signup, request, post, uploadFile, launchServer, shutdownServer } from './utils';
import { Note } from '../src/models/entities/note';
import { initDb } from '../src/db/postgre';
@@ -30,8 +30,8 @@ describe('Note', () => {
bob = await signup({ username: 'bob' });
}));
after(() => {
p.kill();
after(async () => {
await shutdownServer(p);
});
it('投稿できる', async(async () => {