Skip to content

Commit

Permalink
move svg mock to its own entry for easier overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed May 9, 2022
1 parent aa933a7 commit 426afcf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/build/jest/jest.ts
Expand Up @@ -85,10 +85,13 @@ export default function nextJest(options: { dir?: string } = {}) {
'^.+\\.(css|sass|scss)$': require.resolve('./__mocks__/styleMock.js'),

// Handle image imports
'^.+\\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$': require.resolve(
'^.+\\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$': require.resolve(
`./__mocks__/fileMock.js`
),

// Keep .svg to it's own rule to make overriding easy
'^.+\\.(svg)$': require.resolve(`./__mocks__/fileMock.js`),

// custom config comes last to ensure the above rules are matched,
// fixes the case where @pages/(.*) -> src/pages/$! doesn't break
// CSS/image mocks
Expand Down

0 comments on commit 426afcf

Please sign in to comment.