Close database connections after running tests

This commit is contained in:
Michael Jackson 2018-10-30 20:30:13 -07:00
parent 9b9ded57e7
commit 0bc640962c
5 changed files with 1238 additions and 9 deletions

8
jest.config.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
moduleNameMapper: {
"\\.css$": "<rootDir>/modules/__mocks__/styleMock.js"
},
setupTestFrameworkScriptFile:
"<rootDir>/modules/__tests__/setupTestFramework.js",
testMatch: ["**/__tests__/*-test.js"]
};

View File

@ -0,0 +1,3 @@
const closeDatabase = require("./utils/closeDatabase");
afterAll(closeDatabase);

View File

@ -0,0 +1,9 @@
const cache = require('../../utils/cache');
const data = require('../../utils/data');
function closeDatabase() {
cache.quit();
data.quit();
}
module.exports = closeDatabase;

View File

@ -70,14 +70,5 @@
},
"engines": {
"node": "8"
},
"jest": {
"moduleNameMapper": {
"\\.css$": "<rootDir>/modules/__mocks__/styleMock.js"
},
"testPathIgnorePatterns": [
"/node_modules/",
"__tests__/utils"
]
}
}

1218
yarn.lock

File diff suppressed because it is too large Load Diff