JestのTransformerとしてesbuild-jestを使う
$ pnpm add -D @jest/globals jest esbuild-jest
code:jest.config.js
/** @type {import('jest').Config} */
const config = {
transform: {
'^.+\\.tsx?$': 'esbuild-jest',
},
collectCoverage: true,
coverageProvider: 'v8',
};
export default config;