2023-07-25 04:20:23 +08:00
|
|
|
import type { JestConfigWithTsJest } from "ts-jest"
|
|
|
|
|
|
|
|
const jestConfig: JestConfigWithTsJest = {
|
|
|
|
testMatch: ["**/*.test.ts"],
|
|
|
|
testEnvironment: "node",
|
|
|
|
// transform configurations
|
2022-07-06 12:19:58 +08:00
|
|
|
preset: "ts-jest/presets/js-with-ts-esm",
|
|
|
|
extensionsToTreatAsEsm: [".ts"],
|
2023-07-25 04:20:23 +08:00
|
|
|
transformIgnorePatterns: [], // transform node_modules
|
2023-05-25 14:48:26 +08:00
|
|
|
transform: {
|
|
|
|
"^.+\\.tsx?$": [
|
|
|
|
"ts-jest",
|
|
|
|
{
|
|
|
|
importHelpers: true,
|
|
|
|
useESM: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-09-14 16:18:36 +08:00
|
|
|
// coverage
|
|
|
|
collectCoverageFrom: ["src/**/*.{ts,tsx}"],
|
|
|
|
coveragePathIgnorePatterns: ["assets", ".css.d.ts"],
|
|
|
|
verbose: true,
|
2023-07-25 03:56:18 +08:00
|
|
|
detectOpenHandles: true,
|
2021-09-14 16:18:36 +08:00
|
|
|
}
|
2023-05-25 14:48:26 +08:00
|
|
|
|
|
|
|
export default jestConfig
|