-
-
Notifications
You must be signed in to change notification settings - Fork 735
/
jest.config.ts
35 lines (33 loc) · 933 Bytes
/
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
import type { Config } from "@jest/types";
const config: Config.InitialOptions = {
roots: ["./src", "./examples"],
moduleNameMapper: {
"@/test/(.*)": ["<rootDir>/test/$1"],
"react-day-picker": ["<rootDir>/src/index.ts"],
"react-day-picker/(.*)": ["<rootDir>/src/$1.js"],
"^(\\.\\.?\\/.+)\\.jsx?$": "$1" // see https://github.com/kulshekhar/ts-jest/issues/1057
},
testEnvironment: "jsdom",
coverageReporters: ["lcov", "text", "clover"],
setupFilesAfterEnv: ["./test/setup.ts"],
fakeTimers: { enableGlobally: true },
/**
* Configuration for transforming source files before testing Uses @swc/jest
* to quickly transform JavaScript/TypeScript files
*/
transform: {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
jsc: {
transform: {
react: {
runtime: "automatic"
}
}
}
}
]
}
};
export default config;