Skip to content

Commit

Permalink
Allow to customize jest transformIgnorePatterns
Browse files Browse the repository at this point in the history
  • Loading branch information
crubier authored Mar 27, 2022
1 parent 086cf91 commit 6f74264
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/next/build/jest/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 6f74264

Please sign in to comment.