-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
60 lines (52 loc) · 1.22 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
import { type Config } from "jest";
import { type Options as SwcOptions } from "@swc/core";
const config: Config = {
testEnvironment: "jsdom",
transform: {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
swcrc: false,
jsc: {
parser: {
syntax: "typescript",
tsx: true,
},
transform: {
react: {
runtime: "automatic",
},
},
target: "esnext",
},
} satisfies SwcOptions,
],
},
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
moduleNameMapper: {
"\\.scss$": "identity-obj-proxy",
"^(\\.{1,2}/.*)\\.js$": "$1",
},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
coverageProvider: "v8",
coverageThreshold: {
global: {
branches: 98,
functions: 98,
lines: 98,
statements: -10,
},
},
// ensure that all files are picked up correctly and included in the results.
collectCoverageFrom: [
"<rootDir>/app/**/*.{ts,tsx}",
"!<rootDir>/app/robots.ts",
"!<rootDir>/app/sitemap.ts",
"!<rootDir>/app/layout.tsx",
],
extensionsToTreatAsEsm: [".ts", ".tsx"],
};
export default config;