-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
46 lines (43 loc) · 1.09 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
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
import path from "node:path";
import type { Config } from "jest";
const toPath = path_ => path.join(process.cwd(), path_);
import { defaults } from "jest-config";
const config: Config = {
...defaults,
clearMocks: true,
coveragePathIgnorePatterns: ["dist/*", "node_modules"],
transform: {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
jsc: {
transform: {
react: {
runtime: "automatic",
},
},
},
},
],
},
moduleNameMapper: {
"@captn/joy(.*)$": "<rootDir>/packages/joy/src$1",
"@captn/react(.*)$": "<rootDir>/packages/react/src$1",
"@captn/theme(.*)$": "<rootDir>/packages/theme/src$1",
"@captn/utils(.*)$": "<rootDir>/packages/utils/src$1",
},
collectCoverage: true,
coverageDirectory: "./coverage",
coverageProvider: "v8",
coverageReporters: ["lcov", "text", "json"],
coverageThreshold: {
global: {
lines: 80,
},
},
testEnvironment: "jsdom",
transformIgnorePatterns: ["/node_modules/(?!dot-prop).+\\.js$"],
extensionsToTreatAsEsm: [".ts", ".tsx"],
};
export default config;