We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cbc7cc commit 22a3a5aCopy full SHA for 22a3a5a
teardown.js
@@ -1,8 +1,21 @@
1
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');
7
8
module.exports = async function () {
9
debug('Teardown mongod');
10
if (global.__MONGOD__) {
11
await global.__MONGOD__.stop();
12
}
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
+ });
21
};
0 commit comments