Close database connections after running tests
This commit is contained in:
parent
9b9ded57e7
commit
0bc640962c
|
@ -0,0 +1,8 @@
|
|||
module.exports = {
|
||||
moduleNameMapper: {
|
||||
"\\.css$": "<rootDir>/modules/__mocks__/styleMock.js"
|
||||
},
|
||||
setupTestFrameworkScriptFile:
|
||||
"<rootDir>/modules/__tests__/setupTestFramework.js",
|
||||
testMatch: ["**/__tests__/*-test.js"]
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
const closeDatabase = require("./utils/closeDatabase");
|
||||
|
||||
afterAll(closeDatabase);
|
|
@ -0,0 +1,9 @@
|
|||
const cache = require('../../utils/cache');
|
||||
const data = require('../../utils/data');
|
||||
|
||||
function closeDatabase() {
|
||||
cache.quit();
|
||||
data.quit();
|
||||
}
|
||||
|
||||
module.exports = closeDatabase;
|
|
@ -70,14 +70,5 @@
|
|||
},
|
||||
"engines": {
|
||||
"node": "8"
|
||||
},
|
||||
"jest": {
|
||||
"moduleNameMapper": {
|
||||
"\\.css$": "<rootDir>/modules/__mocks__/styleMock.js"
|
||||
},
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"__tests__/utils"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue