mirror of
https://github.com/186526/handlers.js
synced 2024-10-13 00:29:43 +00:00
23 lines
593 B
TypeScript
23 lines
593 B
TypeScript
// jest.config.ts
|
|
import type { JestConfigWithTsJest } from 'ts-jest';
|
|
|
|
const jestConfig: JestConfigWithTsJest = {
|
|
// [...]
|
|
preset: 'ts-jest/presets/default-esm', // or other ESM presets
|
|
moduleNameMapper: {
|
|
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
},
|
|
transform: {
|
|
// '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest`
|
|
// '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest`
|
|
'^.+\\.tsx?$': [
|
|
'ts-jest',
|
|
{
|
|
useESM: true,
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|
|
export default jestConfig;
|