-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjest.config.ts
30 lines (27 loc) · 975 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
/** @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_);
const config: Config = {
clearMocks: true,
collectCoverage: true,
coverageDirectory: "./coverage",
coverageProvider: "v8",
coverageReporters: ["lcov", "text"],
coveragePathIgnorePatterns: ["dist/*", "node_modules"],
moduleFileExtensions: ["js", "mjs", "cjs", "jsx", "ts", "tsx", "json", "node"],
transform: {
"\\.[jt]sx?$": "@swc/jest",
},
transformIgnorePatterns: ["node_modules/(?!humanize-string)/"],
moduleNameMapper: {
"(.+)\\.js": "$1",
"^@hyv/utils": toPath("/packages/utils/src"),
"^@hyv/openai": toPath("/packages/openai/src"),
"^@hyv/store": toPath("/packages/store/src"),
"^@hyv/stable-diffusion": toPath("/packages/stable-diffusion/src"),
"^@hyv/core": toPath("/packages/core/src"),
},
extensionsToTreatAsEsm: [".ts"],
};
export default config;