-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
32 lines (32 loc) · 847 Bytes
/
jest.config.js
File metadata and controls
32 lines (32 loc) · 847 Bytes
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
export default {
preset: "ts-jest",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/src/test/setup.ts"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
transform: {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
},
],
},
testMatch: [
"<rootDir>/src/**/__tests__/**/*.(ts|tsx)",
"<rootDir>/src/**/*.(test|spec).(ts|tsx)",
],
collectCoverageFrom: [
"src/**/*.{ts,tsx}",
"!src/**/*.d.ts",
"!src/**/*.stories.{ts,tsx}",
"!src/index.ts",
],
coverageReporters: ["text", "lcov", "html"],
coverageDirectory: "coverage",
testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/dist/"],
moduleDirectories: ["node_modules", "<rootDir>/src"],
extensionsToTreatAsEsm: [".ts", ".tsx"],
};