From 3509f071fac349027ce6fd8563338305820cd49f Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Thu, 28 Sep 2023 11:41:15 +0800 Subject: [PATCH] fix(jest): fix esm support issue. --- packages/jest/src/jest.config.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/jest/src/jest.config.ts b/packages/jest/src/jest.config.ts index 79dd5d0a..414f6c66 100644 --- a/packages/jest/src/jest.config.ts +++ b/packages/jest/src/jest.config.ts @@ -76,6 +76,12 @@ export default async function jestConfig(resolve: Function, rootDir: string): Pr if (overrides) { const supportedKeys: (keyof Jest.Config)[] = [ + 'preset', + /** + * ESM Support + * https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/ + */ + 'extensionsToTreatAsEsm', /** * https://www.npmjs.com/package/jest-node-exports-resolver * This is heavily discussed in the following [issue #9771](https://github.com/facebook/jest/issues/9771).