Skip to content

Commit 426afcf

Browse files
committed
move svg mock to its own entry for easier overriding
1 parent aa933a7 commit 426afcf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/next/build/jest/jest.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,13 @@ export default function nextJest(options: { dir?: string } = {}) {
8585
'^.+\\.(css|sass|scss)$': require.resolve('./__mocks__/styleMock.js'),
8686

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

92+
// Keep .svg to it's own rule to make overriding easy
93+
'^.+\\.(svg)$': require.resolve(`./__mocks__/fileMock.js`),
94+
9295
// custom config comes last to ensure the above rules are matched,
9396
// fixes the case where @pages/(.*) -> src/pages/$! doesn't break
9497
// CSS/image mocks

0 commit comments

Comments
 (0)