2023-05-25 14:48:26 +08:00
|
|
|
/** @typedef {import("jest")} jestConfig */
|
|
|
|
const jestConfig = {
|
2022-07-06 12:19:58 +08:00
|
|
|
preset: "ts-jest/presets/js-with-ts-esm",
|
|
|
|
extensionsToTreatAsEsm: [".ts"],
|
|
|
|
transformIgnorePatterns: [], // transform everything
|
2021-09-14 16:18:36 +08:00
|
|
|
testEnvironment: "node",
|
|
|
|
testMatch: ["**/*.test.ts"],
|
2021-09-15 04:41:32 +08:00
|
|
|
testPathIgnorePatterns: ["<rootDir>/src/python/setup-python/"],
|
2023-05-25 14:48:26 +08:00
|
|
|
// tsconfig
|
|
|
|
transform: {
|
|
|
|
"^.+\\.tsx?$": [
|
|
|
|
"ts-jest",
|
|
|
|
/** @type {import("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
|