generated from umbraco/Umbraco-Open-Source-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.ts
More file actions
45 lines (42 loc) · 1.15 KB
/
jest.config.ts
File metadata and controls
45 lines (42 loc) · 1.15 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
import type { JestConfigWithTsJest } from "ts-jest";
const shared: Partial<JestConfigWithTsJest> = {
preset: "ts-jest/presets/js-with-ts-esm",
testEnvironment: "node",
maxWorkers: 1,
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"^@/(.*)$": "<rootDir>/src/$1",
},
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
setupFiles: ["<rootDir>/jest.setup.ts"],
testPathIgnorePatterns: ["/node_modules/"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
};
const config: JestConfigWithTsJest = {
projects: [
{
...shared,
displayName: "integration",
testMatch: ["**/__tests__/**/*.test.ts"],
collectCoverageFrom: ["src/**/*.ts", "!src/**/*.d.ts"],
coverageDirectory: "coverage",
} as JestConfigWithTsJest,
{
...shared,
displayName: "evals",
testMatch: ["<rootDir>/tests/evals/**/*.test.ts"],
testTimeout: 120000,
slowTestThreshold: 300,
setupFilesAfterEnv: ["<rootDir>/tests/evals/helpers/e2e-setup.ts"],
} as JestConfigWithTsJest,
],
};
export default config;