-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.ts
63 lines (60 loc) · 1.47 KB
/
jest.config.ts
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
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
import type { Config } from "jest";
const config: Config = {
projects: [
{
displayName: "dom",
clearMocks: true,
coverageDirectory: "coverage",
moduleFileExtensions: [
"js",
"mjs",
"cjs",
"jsx",
"ts",
"tsx",
"json",
"node",
],
testEnvironment: "jsdom",
testMatch: ["**/*.test.tsx"],
transform: {
"^.+\\.tsx?$": "ts-jest",
"^.+\\.(css|scss|sass|less)$": "jest-preview/transforms/css",
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)":
"jest-preview/transforms/file",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/fileTransformer.ts",
},
transformIgnorePatterns: ["/node_modules/"],
},
{
displayName: "node",
clearMocks: true,
coverageDirectory: "coverage",
moduleFileExtensions: [
"js",
"mjs",
"cjs",
"jsx",
"ts",
"tsx",
"json",
"node",
],
testEnvironment: "node",
testMatch: ["**/*.test.ts"],
transform: {
"^.+\\.ts?$": "ts-jest",
},
transformIgnorePatterns: ["/node_modules/"],
},
],
collectCoverage: true,
// collectCoverageFrom: ["./src/**"],
coverageProvider: "babel",
};
export default config;