-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.ts
More file actions
40 lines (38 loc) · 1.05 KB
/
jest.config.ts
File metadata and controls
40 lines (38 loc) · 1.05 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
import type { Config } from "jest";
const config: Config = {
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/src"],
testMatch: ["**/__tests__/**/*.test.ts", "**/?(*.)+(spec|test).ts"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
collectCoverageFrom: [
"src/**/*.{ts,tsx}",
"!src/**/*.d.ts",
"!src/**/__tests__/**",
"!src/instrumentation.ts", // Exclude OpenTelemetry instrumentation
],
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov", "html"],
globalSetup: "<rootDir>/src/__tests__/globalSetup.ts",
globalTeardown: "<rootDir>/src/__tests__/globalTeardown.ts",
setupFilesAfterEnv: ["<rootDir>/src/__tests__/setup.ts"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
},
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: {
esModuleInterop: true,
allowSyntheticDefaultImports: true,
},
},
],
},
testTimeout: 10000,
clearMocks: true,
resetMocks: true,
restoreMocks: true,
};
export default config;