# jest v30.5.0 - Product: jest (https://whatsnew.fyi/product/jest) - Vendor: jest - Date: 2026-08-28 - Version: v30.5.0 - Original notes: https://github.com/jestjs/jest/releases/tag/v30.5.0 - Permalink: https://whatsnew.fyi/product/jest/releases/v30.5.0 What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. --- - **added** — Mock functions can now configure return values per argument list with `whenCalledWith()` method that accepts literals or asymmetric matchers - **added** — `jest.retryTimes()` can now retry an entire `describe` block with `{entireDescribe: true}` option, rerunning `beforeAll`/`afterAll` hooks and child tests - **added** — Snapshot failures expose the `.snap` file path as `matcherResult.snapshotPath` in `failureDetails` - **added** — `--collectTests` expands `test.each`/`describe.each` cases and reports per-status counts plus a summary line - **added** — Automocking and manual `__mocks__` files now apply to ESM on Node 24.9+, supporting static imports, dynamic `import()` and `require()` of ESM files - **changed** — Replace `source-map-support` with an implementation in `@jest/source-map` to fix memory leaks and improve source map handling - **changed** — Rewrite the non-watchman path of `jest-haste-map` with `@parcel/watcher` replacing `NodeWatcher` and `FSEventsWatcher` - **changed** — Replace hand-rolled directory recursion in the crawler with `fdir` - **changed** — Update `babel-plugin-istanbul` to v8 - **changed** — Update `glob` to v13 - **changed** — Warm module resolution costs about a third of what it did with repeated work removed from the resolution hot path - **changed** — Reduce per-`require` overhead in `jest-runtime` by skipping module ID resolution when no mock can apply and having core modules answer before manual-mock probe - **changed** — `jest-snapshot` loads babel, semver and synckit lazily to reduce module count in every test process by ~200 - **changed** — `jest-haste-map` caches the watchman socket path to eliminate watchman processes on warm runs and reuses cached metadata for duplicated haste names - **fixed** — Fix watching and indexing to survive locked files on Windows, watchman failures, and duplicate manual mocks - **fixed** — `jest.unstable_mockModule` mocks now apply when the mocked file is `require()`d directly - **fixed** — Async factories in `jest.unstable_mockModule` run once and fail the import instead of crashing the worker - **fixed** — Mocks made inside `jest.isolateModules` stay scoped to that block - **fixed** — `AggregateError` inner errors and nested `cause` chains render with code frames and per-level indentation and are included in `--json` output, `retryReasons` and reporter annotations On a personal note: King Harald V of Norway passed away this morning. He ascended the throne 35 years ago, two months before I was born. This release is dedicated to his memory. Hvil i fred 🇳🇴 --- This is a big release. It touches `jest-runtime`, `jest-resolve` and `jest-haste-map` in many places, and with this many changes there might be regressions 😬. If your suite behaves differently after upgrading, please [open an issue](https://github.com/jestjs/jest/issues). #### Highlights ##### `whenCalledWith` Mock functions can now configure return values per argument list, contributed by [@timkindberg](https://github.com/timkindberg) ([#16053](https://github.com/jestjs/jest/pull/16053)): ```js const fn = jest.fn(); fn.whenCalledWith('apple').mockReturnValue('red'); fn.whenCalledWith('banana').mockReturnValue('yellow'); fn.whenCalledWith(expect.any(Number)).mockReturnValue('numeric'); fn('apple'); // 'red' fn('banana'); // 'yellow' fn(42); // 'numeric' fn('grape'); // undefined ``` The returned object is a real `Mock`, so `mockReturnValueOnce`, `mockResolvedValue`, `mockImplementation` etc. all chain here too. Argument slots accept literals or any asymmetric matcher, with the same equality semantics as `toHaveBeenCalledWith()`. Calls that match nothing fall through to the base mock. See the [Mock Functions docs](https://jestjs.io/docs/mock-function-api#mockfnwhencalledwithargs) for matching and precedence details. ##### Describe-level retries `jest.retryTimes()` can now retry a whole `describe` block instead of a single test, contributed by [@soltonigiri](https://github.com/soltonigiri) ([#16322](https://github.com/jestjs/jest/pull/16322)). Each attempt reruns the block's `beforeAll`/`afterAll` hooks, child tests and nested describes, which helps when tests in a block depend on shared state: ```js describe('workflow', () => { jest.retryTimes(3, {entireDescribe: true}); test('first step', () => {}); test('second step', () => {}); // a failure retries the entire block }); ``` ##### New file watcher The non-watchman path of `jest-haste-map` is rewritten. `@parcel/watcher` replaces the homegrown `NodeWatcher` and `FSEventsWatcher` ([#16188](https://github.com/jestjs/jest/pull/16188)), and `fdir` replaces the hand-rolled directory recursion in the crawler ([#16187](https://github.com/jestjs/jest/pull/16187)). A batch of fixes also makes watching and indexing survive locked files on Windows, watchman failures, and duplicate manual mocks ([#16295](https://github.com/jestjs/jest/pull/16295), [#16358](https://github.com/jestjs/jest/pull/16358), [#16355](https://github.com/jestjs/jest/pull/16355), [#16360](https://github.com/jestjs/jest/pull/16360)). If you can, please run your suite with `--no-watchman` (in and out of watch mode) to exercise the new crawler and watchers, and report anything odd 👍 ##### Long-requested dependency updates - `babel-plugin-istanbul` is updated to v8 ([#16049](https://github.com/jestjs/jest/pull/16049)) - `glob` is updated to v13 ([#16397](https://github.com/jestjs/jest/pull/16397)) - `source-map-support` is replaced with an implementation in `@jest/source-map` ([#16327](https://github.com/jestjs/jest/pull/16327)). This fixes a memory leak where `source-map-support`'s process-global caches pinned every finished test file's sandbox. Source maps also survive environment teardown, `--testLocationInResults` looks up the right column, and scheme-prefixed sources like `webpack:///` are kept as-is. ##### Performance - Warm module resolution costs about a third of what it did, and repeated work is gone from the resolution hot path ([#16373](https://github.com/jestjs/jest/pull/16373), [#16371](https://github.com/jestjs/jest/pull/16371)). - Per-`require` overhead in `jest-runtime` is cut: module ID resolution is skipped when no mock can apply, and core modules answer before the manual-mock probe ([#16376](https://github.com/jestjs/jest/pull/1 _[Truncated at 4000 characters — full notes: https://github.com/jestjs/jest/releases/tag/v30.5.0]_