Skip to content

Commit 39b65e2

Browse files
authored
Merge pull request #359 from dozgunyal/master
2 parents 5cbc7cc + 22a3a5a commit 39b65e2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

teardown.js

+13
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
const debug = require('debug')('jest-mongodb:teardown');
2+
const {join} = require('path');
3+
const fs = require('fs');
4+
5+
const cwd = process.cwd();
6+
const globalConfigPath = join(cwd, 'globalConfig.json');
27

38
module.exports = async function () {
49
debug('Teardown mongod');
510
if (global.__MONGOD__) {
611
await global.__MONGOD__.stop();
712
}
13+
fs.unlink(globalConfigPath, err => {
14+
if (err) {
15+
debug('Config could not be deleted');
16+
17+
return;
18+
}
19+
debug('Config is deleted');
20+
});
821
};

0 commit comments

Comments
 (0)