Skip to content

chore(deps): update dependency jest-when to v4#304

Open
specmatic-builder wants to merge 1 commit intomasterfrom
renovate/jest-when-4.x
Open

chore(deps): update dependency jest-when to v4#304
specmatic-builder wants to merge 1 commit intomasterfrom
renovate/jest-when-4.x

Conversation

@specmatic-builder
Copy link
Copy Markdown
Contributor

@specmatic-builder specmatic-builder commented Mar 24, 2026

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
jest-when ^3.6.0^4.0.0 age adoption passing confidence

Release Notes

timkindberg/jest-when (jest-when)

v4.0.1

Compare Source

v4.0.0: 4.0.0

Compare Source

Highlights

  • jest-when is now authored in TypeScript
  • fixes a number of long-standing typing issues, especially around wrapper mocks, calledWith inference, and void / Promise<void> cases
  • compatibility is now verified in both Jest 29 and Jest 27 environments

What changed

Native TypeScript source

The library source has been migrated from JavaScript to TypeScript, with the public type contract now tested directly in the repo.

Stronger, more accurate typings

This release tightens a number of important typing behaviors:

  • calledWith / expectCalledWith preserve argument tuple types again
  • mockReturnValue / mockResolvedValue / related methods track the mocked function's return type much more accurately
  • void / Promise<void> cases allow omitted values correctly
  • better support for function-like wrapper mocks, including jest-mock-extended-style mocked object methods
  • typed casts, mocked module functions, spies, optional args, rest args, allArgs, and matcher cases are now covered by contract tests
Compatibility guardrails

The repo now has:

  • a primary Jest 29 development environment
  • a dedicated compat/jest27 workspace

The full build, runtime tests, and type tests run in both environments. This was added specifically to avoid fixing newer Jest/mock ecosystems while regressing older supported ones.

Breaking changes

  • minimum supported Jest version is now 27
  • TypeScript usages that previously compiled because the old typings were too loose may now fail typechecking

There are no intentional runtime API changes in this release.

Thanks

Thanks to @​tlevesque-ueat for the repros, patience, and repeated validation while this got sorted out.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot. Specmatic specific configuration is managed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant