-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
37 lines (35 loc) · 974 Bytes
/
jest.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import type { Config } from "jest";
const config: Config = {
moduleFileExtensions: ["js", "ts"],
collectCoverageFrom: ["**/*.ts", "!**/node_modules/**", "!**/vendor/**"],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: -10,
},
},
displayName: "Password Validator",
extensionsToTreatAsEsm: [".ts"],
roots: ["<rootDir>/src/"],
testMatch: ["**/test/**/*.ts", "**/?(*.)+(spec|test).ts"],
verbose: true,
preset: "ts-jest/presets/default-esm", // or other ESM presets
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
coveragePathIgnorePatterns: ["src/password/usages/*"],
testPathIgnorePatterns: ["src/password/usages/*"],
};
export default config;