From 6f742646450c26da7b13fe2568cd1c97ff33fe3c Mon Sep 17 00:00:00 2001 From: Vincent Lecrubier Date: Sun, 27 Mar 2022 17:45:42 +0100 Subject: [PATCH] Allow to customize jest transformIgnorePatterns --- packages/next/build/jest/jest.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/next/build/jest/jest.ts b/packages/next/build/jest/jest.ts index 4af9d9afb83a7..c1dab8330c350 100644 --- a/packages/next/build/jest/jest.ts +++ b/packages/next/build/jest/jest.ts @@ -88,14 +88,11 @@ export default function nextJest(options: { dir?: string } = {}) { // Custom config will be able to override the default mappings ...(resolvedJestConfig.moduleNameMapper || {}), }, - testPathIgnorePatterns: [ + testPathIgnorePatterns: resolvedJestConfig.testPathIgnorePatterns || [ // Don't look for tests in node_modules '/node_modules/', // Don't look for tests in the Next.js build output '/.next/', - // Custom config can append to testPathIgnorePatterns but not modify it - // This is to ensure `.next` and `node_modules` are always excluded - ...(resolvedJestConfig.testPathIgnorePatterns || []), ], transform: {