Skip to content

Commit 59a7ed6

Browse files
committed
refacto: add async/await to afterAll event in DB tests to remove warning after test logs
1 parent 4902b36 commit 59a7ed6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/__tests__/multipleDB-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ beforeAll(async () => {
2222
db2 = con2.db(await mongoServer1.getDbName());
2323
});
2424

25-
afterAll(() => {
25+
afterAll(async () => {
2626
if (con1) con1.close();
2727
if (con2) con2.close();
28-
if (mongoServer1) mongoServer1.stop();
29-
if (mongoServer2) mongoServer2.stop();
28+
if (mongoServer1) await mongoServer1.stop();
29+
if (mongoServer2) await mongoServer2.stop();
3030
});
3131

3232
describe('Multiple mongoServers', () => {

src/__tests__/singleDB-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ beforeAll(async () => {
1414
db = con.db(await mongoServer.getDbName());
1515
});
1616

17-
afterAll(() => {
17+
afterAll(async () => {
1818
if (con) con.close();
19-
if (mongoServer) mongoServer.stop();
19+
if (mongoServer) await mongoServer.stop();
2020
});
2121

2222
describe('Single mongoServer', () => {

0 commit comments

Comments
 (0)