-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
45 lines (39 loc) · 1.03 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
import { type JestConfigWithTsJest } from "ts-jest";
const config: JestConfigWithTsJest = {
preset: "ts-jest/presets/default-esm",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
extensionsToTreatAsEsm: [".ts", ".tsx"],
moduleNameMapper: {
"\\.scss$": "identity-obj-proxy",
"^(\\.{1,2}/.*)\\.js$": "$1",
},
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: "./tsconfig.test.json",
},
],
},
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",
],
};
export default config;