2022-05-31 16:29:10 +02:00
|
|
|
const { pathsToModuleNameMapper } = require("ts-jest");
|
|
|
|
|
2023-05-22 20:19:16 +02:00
|
|
|
const { compilerOptions } = require("./tsconfig");
|
2022-08-11 03:35:08 +02:00
|
|
|
|
2023-05-22 20:19:16 +02:00
|
|
|
const sharedConfig = require("../../libs/shared/jest.config.ts");
|
|
|
|
|
|
|
|
/** @type {import('jest').Config} */
|
2022-05-31 16:29:10 +02:00
|
|
|
module.exports = {
|
2022-11-18 13:20:19 +01:00
|
|
|
...sharedConfig,
|
2022-05-31 16:29:10 +02:00
|
|
|
preset: "ts-jest",
|
2022-11-18 13:20:19 +01:00
|
|
|
testEnvironment: "node",
|
2022-08-11 03:35:08 +02:00
|
|
|
setupFilesAfterEnv: ["<rootDir>/test.setup.ts"],
|
2024-10-07 13:20:50 +02:00
|
|
|
moduleNameMapper: {
|
|
|
|
"@bitwarden/common/platform/services/sdk/default-sdk-client-factory":
|
|
|
|
"<rootDir>/../../libs/common/spec/jest-sdk-client-factory",
|
|
|
|
...pathsToModuleNameMapper(compilerOptions?.paths || {}, {
|
|
|
|
prefix: "<rootDir>/",
|
|
|
|
}),
|
|
|
|
},
|
2022-05-31 16:29:10 +02:00
|
|
|
};
|