forked from Patrick-Ehimen/lighthouse-agent-tooling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
47 lines (47 loc) · 1.21 KB
/
jest.config.js
File metadata and controls
47 lines (47 loc) · 1.21 KB
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
38
39
40
41
42
43
44
45
46
47
/** @type {import('jest').Config} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/packages/shared", "<rootDir>/apps"],
testMatch: ["**/__tests__/**/*.ts", "**/?(*.)+(spec|test).ts"],
collectCoverageFrom: [
"packages/shared/src/**/*.ts",
"apps/*/src/**/*.ts",
"!**/*.d.ts",
"!**/node_modules/**",
"!**/dist/**",
"!**/build/**",
],
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov", "html", "json-summary"],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
moduleNameMapping: {
"^@lighthouse-tooling/(.*)$": "<rootDir>/packages/$1/src",
},
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
testTimeout: 10000,
verbose: true,
// CI-friendly configuration
ci: process.env.CI === "true",
maxWorkers: process.env.CI ? 2 : "50%",
// Transform configuration for TypeScript
transform: {
"^.+\\.ts$": [
"ts-jest",
{
tsconfig: "tsconfig.json",
},
],
},
// Module file extensions
moduleFileExtensions: ["ts", "js", "json"],
// Ignore patterns
testPathIgnorePatterns: ["/node_modules/", "/dist/", "/build/"],
};