2023-07-25 04:20:39 +08:00
|
|
|
import type { Config } from "jest"
|
2023-07-25 04:20:23 +08:00
|
|
|
|
2023-07-25 04:20:39 +08:00
|
|
|
const jestConfig: Config = {
|
2023-07-25 04:20:23 +08:00
|
|
|
testMatch: ["**/*.test.ts"],
|
|
|
|
testEnvironment: "node",
|
2023-07-25 04:20:39 +08:00
|
|
|
extensionsToTreatAsEsm: [".ts", ".tsx", ".js", ".jsx"],
|
2023-07-25 04:20:23 +08:00
|
|
|
transformIgnorePatterns: [], // transform node_modules
|
2023-05-25 14:48:26 +08:00
|
|
|
transform: {
|
2023-07-25 04:20:39 +08:00
|
|
|
"^.+\\.(t|j)sx?$": "@swc/jest",
|
2023-05-25 14:48:26 +08:00
|
|
|
},
|
2021-09-14 16:18:36 +08:00
|
|
|
// coverage
|
2023-07-25 04:20:39 +08:00
|
|
|
collectCoverageFrom: ["src/**/*.{ts,tsx,js,jsx}"],
|
2021-09-14 16:18:36 +08:00
|
|
|
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
|