From 17a7e1ed8bd59d41906e9aebefca620e40414eda Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 30 Jul 2024 22:39:56 +0800 Subject: [PATCH] feat(jest): support `modulePathIgnorePatterns` config. --- packages/jest/src/index.ts | 2 +- packages/jest/src/jest.config.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/jest/src/index.ts b/packages/jest/src/index.ts index 0e98973b..12e39cca 100644 --- a/packages/jest/src/index.ts +++ b/packages/jest/src/index.ts @@ -1,6 +1,6 @@ import path, { dirname } from 'path'; import { runCLI } from '@jest/core'; -import { Config } from '@jest/types'; +import { type Config } from '@jest/types'; import { fileURLToPath } from 'url'; import createJestConfig from './jest.config.js'; diff --git a/packages/jest/src/jest.config.ts b/packages/jest/src/jest.config.ts index 0c142903..c8e8f2b2 100644 --- a/packages/jest/src/jest.config.ts +++ b/packages/jest/src/jest.config.ts @@ -76,6 +76,15 @@ export default async function jestConfig(resolve: Function, rootDir: string): Pr if (overrides) { const supportedKeys: (keyof Jest.Config)[] = [ + /** + * https://jestjs.io/docs/configuration#modulepathignorepatterns-arraystring + * ```js + * const config = { + * modulePathIgnorePatterns: ['/build/'], + * }; + * ``` + */ + 'modulePathIgnorePatterns', /** * https://jestjs.io/docs/configuration#setupfiles-array *