From d536f6f3e544ec66181237abafc5771c3b67a9b7 Mon Sep 17 00:00:00 2001 From: Ruan Barroso Date: Mon, 1 Jun 2026 10:47:34 -0300 Subject: [PATCH] Fix misspelled moduleNameMapper key in jest.config.js The custom Jest config used `moduleNameMapping`, which is not a valid Jest option, producing on every run: Validation Warning: Unknown option "moduleNameMapping" was found. This means your test cases might not behave as expected. The hand-written `^@/(.*)$` -> `/src/$1` mapping was silently ignored; the `@/` alias only resolved because next/jest injects its own moduleNameMapper derived from tsconfig paths. Renaming the key to the correct `moduleNameMapper` makes the entry valid and lets it merge with next/jest's generated mapper. Verified: `npm test` runs with no validation warning and all tests pass. Co-Authored-By: Claude Opus 4.8 --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 5ca44c8..fd26b2d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -15,7 +15,7 @@ const customJestConfig = { '!src/**/*.d.ts', '!src/**/*.stories.{js,jsx,ts,tsx}', ], - moduleNameMapping: { + moduleNameMapper: { '^@/(.*)$': '/src/$1', }, }