diff --git a/packages/next/build/jest/jest.ts b/packages/next/build/jest/jest.ts index c138f500d007151..6f7c2432a66bd4f 100644 --- a/packages/next/build/jest/jest.ts +++ b/packages/next/build/jest/jest.ts @@ -157,7 +157,7 @@ export default function nextJest(options: { dir?: string } = {}) { // To match Next.js behavior node_modules is not transformed, only `transpiledPackages` ...(transpiled ? [ - `/node_modules/(?!(${transpiled}))/`, + `/node_modules/(?!.pnpm)(?!(${transpiled})/)`, `/node_modules/.pnpm/(?!(${transpiled.replace( /\//g, '\\+'