-
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.51 KB
/
jest.config.js
File metadata and controls
41 lines (41 loc) · 1.51 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
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
// Coverage collection is scoped to the commands layer.
// Unit tests mock infra/engines entirely — that layer is validated by E2E tests.
collectCoverageFrom: ["<rootDir>/src/commands/**/*.ts"],
coverageThreshold: {
global: { lines: 95, functions: 95, branches: 95, statements: 95 },
},
projects: [
{
displayName: "unit",
preset: "ts-jest/presets/default-esm",
testEnvironment: "node",
extensionsToTreatAsEsm: [".ts"],
transform: { "^.+\\.tsx?$": ["ts-jest", { useESM: true }] },
moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1" },
testMatch: ["<rootDir>/tests/unit/**/*.test.ts"],
},
{
displayName: "e2e",
preset: "ts-jest/presets/default-esm",
testEnvironment: "node",
extensionsToTreatAsEsm: [".ts"],
transform: { "^.+\\.tsx?$": ["ts-jest", { useESM: true }] },
moduleFileExtensions: ["ts", "js", "mjs", "cjs", "json", "node"],
moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1" },
testMatch: ["<rootDir>/tests/e2e/**/*.test.ts"],
testTimeout: 120_000,
},
{
displayName: "integration",
preset: "ts-jest/presets/default-esm",
testEnvironment: "node",
extensionsToTreatAsEsm: [".ts"],
transform: { "^.+\\.tsx?$": ["ts-jest", { useESM: true }] },
moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1" },
testMatch: ["<rootDir>/tests/integration/**/*.test.ts"],
testTimeout: 10_000,
},
],
};