-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
41 lines (41 loc) · 1.02 KB
/
jest.config.js
File metadata and controls
41 lines (41 loc) · 1.02 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
// jest.config.js
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
testMatch: ["**/**/*.test.ts"], // Automatically find test files ending in .test.ts
collectCoverageFrom: [
"src/**/*.ts",
"!src/**/*.test.ts",
"!src/test/**",
"!src/types/**",
"!src/constants/**",
"!src/index.ts",
],
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov", "html"],
setupFilesAfterEnv: ["<rootDir>/src/test/setup.ts"],
verbose: true,
forceExit: true,
clearMocks: true,
// Increase timeout for worker-based tests
testTimeout: 10000,
// Simple fix: just mock uuid for tests
moduleNameMapper: {
"^uuid$": "<rootDir>/src/test/__mocks__/uuid.ts",
},
// Global setup for browser environment mocking
globals: {
"ts-jest": {
tsconfig: {
target: "es2020",
module: "commonjs",
moduleResolution: "node",
esModuleInterop: true,
allowSyntheticDefaultImports: true,
lib: ["es2020", "dom"],
types: ["node", "jest"],
},
},
},
};