Skip to content

Commit 6ba15fe

Browse files
committed
Close connection after all
1 parent c3de65d commit 6ba15fe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/apps/mooc_backend/features/step_definitions/controller.steps.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { Given, Then } from 'cucumber';
1+
import assert from 'assert';
2+
import { Given, Then, AfterAll } from 'cucumber';
23
import request from 'supertest';
34
import app from '../../../../../src/apps/mooc_backend/app';
4-
import assert from 'assert';
5+
import container from '../../../../../src/apps/mooc_backend/config/dependency-injection';
56

67
let _request: request.Test;
78
let _response: request.Response;
@@ -23,3 +24,8 @@ Then('the response status code should be {int}', async (status: number) => {
2324
Then('the response should be empty', () => {
2425
assert.deepEqual(_response.body, {});
2526
});
27+
28+
AfterAll(async () => {
29+
const connectionManager = container.get('Mooc.ConnectionManager');
30+
await (await connectionManager).close();
31+
});

0 commit comments

Comments
 (0)