Back to Daily Feed 
Jest v30.5.0: `whenCalledWith`, Describe Retries & New File Watcher
Must Read
Originally published on Jest Releases
View Original Article
Share this article:
Summary & Key Takeaways
- Mock functions now support
whenCalledWithto configure return values based on specific arguments. jest.retryTimes()can now be applied to entiredescribeblocks, rerunning all hooks and tests.- The file watcher for non-Watchman environments has been rewritten using
@parcel/watcher. fdirreplaces hand-rolled directory recursion in the crawler.- The release touches
jest-runtime,jest-resolve, andjest-haste-mapextensively. - Argument slots for
whenCalledWithaccept literals or asymmetric matchers.
Our Commentary
This is a genuinely big release for Jest, despite being a minor version. whenCalledWith is a game-changer for mocking complex scenarios, and describe-level retries will save so much headache for flaky integration tests. I'm also curious about the new file watcher; performance improvements there are always welcome. It's a solid set of features that will make testing more robust and flexible.
View Original Article
Share this article: