-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.mjs
More file actions
96 lines (96 loc) · 2.58 KB
/
Copy pathjest.config.mjs
File metadata and controls
96 lines (96 loc) · 2.58 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
export default {
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/shared", "<rootDir>/src", "<rootDir>/webview-src"],
testMatch: ["**/__tests__/**/*.test.ts", "**/?(*.)+(spec|test).ts"],
testPathIgnorePatterns: ["/node_modules/", "/out/", "/webview/"],
// Avoid picking up compiled manual mocks from the build output
modulePathIgnorePatterns: ["/out/"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
collectCoverageFrom: [
"shared/**/*.ts",
"src/**/*.ts",
"webview-src/**/*.ts",
"!**/*.d.ts",
"!**/node_modules/**",
"!**/generated/**",
"!**/__tests__/**",
"!**/*.test.ts",
],
moduleNameMapper: {
"^shared/(.*)$": "<rootDir>/shared/$1",
},
reporters: [
"default",
[
"jest-junit",
{
outputDirectory: "test-results",
outputName: "jest-junit.xml",
classNameTemplate: "{filename}",
titleTemplate: "{title}",
},
],
],
setupFilesAfterEnv: ["<rootDir>/jest.setup.mjs"],
projects: [
{
displayName: "webview",
testEnvironment: "jsdom",
testMatch: ["<rootDir>/webview-src/**/*.test.ts"],
testPathIgnorePatterns: ["/node_modules/", "/out/", "/webview/"],
modulePathIgnorePatterns: ["/out/"],
preset: "ts-jest",
transform: {
"^.+\\.ts$": [
"ts-jest",
{
tsconfig: "tsconfig.webview-test.json",
},
],
},
moduleNameMapper: {
"^shared/(.*)$": "<rootDir>/shared/$1",
},
},
{
displayName: "extension",
testEnvironment: "node",
testMatch: ["<rootDir>/src/**/*.test.ts"],
testPathIgnorePatterns: ["/node_modules/", "/out/", "/webview/"],
modulePathIgnorePatterns: ["/out/"],
preset: "ts-jest",
transform: {
"^.+\\.ts$": [
"ts-jest",
{
tsconfig: "tsconfig.extension-test.json",
},
],
},
moduleNameMapper: {
"^shared/(.*)$": "<rootDir>/shared/$1",
"^vscode$": "<rootDir>/src/__mocks__/vscode.ts",
},
},
{
displayName: "shared",
testEnvironment: "node",
testMatch: ["<rootDir>/shared/**/*.test.ts"],
testPathIgnorePatterns: ["/node_modules/", "/out/", "/webview/"],
modulePathIgnorePatterns: ["/out/"],
preset: "ts-jest",
transform: {
"^.+\\.ts$": [
"ts-jest",
{
tsconfig: "tsconfig.shared-test.json",
},
],
},
moduleNameMapper: {
"^vscode$": "<rootDir>/src/__mocks__/vscode.ts",
},
},
],
};