mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
[EC-423] Fix unit tests (#3265)
* Create base jest.config file * Fix various tests that were broken * Add maxWorkers to jest config * Undo change to testEnvironment * Enable tsconfig.spec.json
This commit is contained in:
19
libs/shared/jest.config.base.js
Normal file
19
libs/shared/jest.config.base.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/* eslint-env node */
|
||||
module.exports = {
|
||||
testMatch: ["**/+(*.)+(spec).+(ts)"],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ["html", "lcov"],
|
||||
coverageDirectory: "coverage",
|
||||
|
||||
// Workaround for a memory leak that crashes tests in CI:
|
||||
// https://github.com/facebook/jest/issues/9430#issuecomment-1149882002
|
||||
// Also anecdotally improves performance when run locally
|
||||
maxWorkers: 3,
|
||||
|
||||
// Jest does not use tsconfig.spec.json by default
|
||||
globals: {
|
||||
"ts-jest": {
|
||||
tsconfig: "<rootDir>/tsconfig.spec.json",
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user