-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
32 lines (30 loc) · 982 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
import type { Config } from "@jest/types";
const config: Config.InitialOptions = {
testEnvironment: "jest-environment-jsdom",
transform: {
"^.+\\.(j|t)sx?$": ["@swc/jest", { configFile: ".swcrc" }],
},
testRegex: "(/__tests__/.*|(\\.|/)spec)\\.(ts|tsx)?$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", ".css", ".module"],
verbose: true,
roots: ["<rootDir>/src/"],
setupFiles: ["<rootDir>/jest.setup.env.ts"],
moduleNameMapper: {
"(svg)$": "<rootDir>/test/mocks/file-mock.ts",
"(css)$": "<rootDir>/node_modules/identity-obj-proxy",
"^@components(.*)$": "<rootDir>/src/components$1",
"^@constants(.*)$": "<rootDir>/src/constants$1",
"^@test$": "<rootDir>/test/index.ts",
"^@test/(.*)$": "<rootDir>/test/$1",
"^root/(.*)$": "<rootDir>/$1",
},
collectCoverageFrom: [
"src/**/*.{ts,tsx}",
"!src/@types/*.ts",
"!**/node_modules/**",
"!test/**",
"!fixtures/**",
"!dist/**",
],
};
export default config;