Change8

v30.5.1

Breaking Changes
📦 jestView on GitHub →
2 breaking🐛 3 fixes🔧 6 symbols

Summary

This release addresses several configuration issues in Jest, including how global-only options are handled in project configs and the behavior of `moduleNameMapper`. It also restores ESM import specifier resolution.

⚠️ Breaking Changes

  • The `reporters`, `coverageReporters`, `workerIdleMemoryLimit`, `cwd`, and `runnerOptions` options are no longer accepted in a project config. Previously, they were silently ignored; now, they will generate a warning. This change is part of ensuring that global-only options are handled consistently.
  • The `maxWorkers` and `coverageThreshold` options will now warn when used in a project config instead of being silently dropped.

Migration Steps

  1. If you were using `reporters`, `coverageReporters`, `workerIdleMemoryLimit`, `cwd`, or `runnerOptions` in a project config, move these options to the root config or ensure they are not present in project-specific configurations.
  2. If you were using `maxWorkers` or `coverageThreshold` in a project config, ensure these are correctly placed in the root configuration or remove them from project configs to avoid warnings.

🐛 Bug Fixes

  • Prevented warnings about global-only options in Jest configs that supply the global config.
  • Ensured that `moduleNameMapper` patterns are matched against the specifier as written, reverting a previous change.
  • Restored the resolution of package `imports` specifiers (e.g., `#dep`) under ESM.

Affected Symbols