2022-05-09 18:25:17 +02:00
|
|
|
const { pathsToModuleNameMapper } = require("ts-jest");
|
2022-03-28 16:00:42 +02:00
|
|
|
|
|
|
|
const { compilerOptions } = require("./tsconfig");
|
|
|
|
|
2023-05-22 20:19:16 +02:00
|
|
|
/** @type {import('jest').Config} */
|
2022-03-28 16:00:42 +02:00
|
|
|
module.exports = {
|
2023-01-11 15:01:02 +01:00
|
|
|
reporters: ["default", "jest-junit"],
|
|
|
|
|
2022-03-28 16:00:42 +02:00
|
|
|
collectCoverage: true,
|
|
|
|
coverageReporters: ["html", "lcov"],
|
|
|
|
coverageDirectory: "coverage",
|
2023-05-22 20:19:16 +02:00
|
|
|
|
2022-03-28 16:00:42 +02:00
|
|
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, {
|
|
|
|
prefix: "<rootDir>/",
|
|
|
|
}),
|
|
|
|
projects: [
|
2022-06-14 17:10:53 +02:00
|
|
|
"<rootDir>/apps/browser/jest.config.js",
|
|
|
|
"<rootDir>/apps/cli/jest.config.js",
|
2022-09-15 18:31:15 +02:00
|
|
|
"<rootDir>/apps/desktop/jest.config.js",
|
2022-08-11 03:35:08 +02:00
|
|
|
"<rootDir>/apps/web/jest.config.js",
|
2022-08-15 16:08:06 +02:00
|
|
|
"<rootDir>/bitwarden_license/bit-web/jest.config.js",
|
2022-06-14 17:10:53 +02:00
|
|
|
|
2023-12-15 15:02:21 +01:00
|
|
|
"<rootDir>/libs/admin-console/jest.config.js",
|
2022-06-14 17:10:53 +02:00
|
|
|
"<rootDir>/libs/angular/jest.config.js",
|
2023-08-08 15:37:25 +02:00
|
|
|
"<rootDir>/libs/auth/jest.config.js",
|
2023-12-15 15:02:21 +01:00
|
|
|
"<rootDir>/libs/billing/jest.config.js",
|
2022-06-14 17:10:53 +02:00
|
|
|
"<rootDir>/libs/common/jest.config.js",
|
2022-08-08 18:21:46 +02:00
|
|
|
"<rootDir>/libs/components/jest.config.js",
|
2023-04-19 11:30:46 +02:00
|
|
|
"<rootDir>/libs/exporter/jest.config.js",
|
2023-08-08 15:37:25 +02:00
|
|
|
"<rootDir>/libs/importer/jest.config.js",
|
2023-12-15 15:02:21 +01:00
|
|
|
"<rootDir>/libs/platform/jest.config.js",
|
2022-06-14 17:10:53 +02:00
|
|
|
"<rootDir>/libs/node/jest.config.js",
|
2023-08-22 16:02:48 +02:00
|
|
|
"<rootDir>/libs/vault/jest.config.js",
|
2022-03-28 16:00:42 +02:00
|
|
|
],
|
2022-08-11 03:35:08 +02:00
|
|
|
|
|
|
|
// 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,
|
2022-03-28 16:00:42 +02:00
|
|
|
};
|