Files
OpenFrontIO/jest.config.ts
T
Scott Anderson ebc0525c89 Enforce minimum test coverage (#1646)
## Description:

Enforce minimum test coverage.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
2025-07-30 22:35:23 -04:00

40 lines
1.1 KiB
TypeScript

export default {
testEnvironment: "node",
testRegex: "/tests/.*\\.(test|spec)?\\.(ts|tsx)$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/__mocks__/fileMock.js",
},
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: {
target: "ES2020",
module: "es2022",
moduleResolution: "node",
experimentalDecorators: true,
types: ["jest", "node"],
},
},
],
},
transformIgnorePatterns: ["node_modules/(?!(node:)/)"],
preset: "ts-jest/presets/default-esm",
collectCoverageFrom: ["src/**/*.ts", "!src/**/*.d.ts"],
coverageThreshold: {
global: {
statements: 22.2,
branches: 17.5,
lines: 22.7,
functions: 21.2,
},
},
coverageReporters: ["text", "lcov", "html"],
};