Skip to content

chore(deps-dev): bump jest-when from 3.7.0 to 4.0.3 - #11

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/jest-when-4.0.3
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/jest-when-4.0.3

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Bumps jest-when from 3.7.0 to 4.0.3.

Release notes

Sourced from jest-when's releases.

v4.0.3

Fixes

  • Restore pre-v4 behavior where .defaultImplementation() (and aliases .defaultReturnValue() / .defaultResolvedValue() / .defaultRejectedValue()) no longer silently drops prior bare .calledWith() / .calledWith(undefined, ...) registrations. Regression introduced in the v4 TypeScript port (#111) and fixed by restoring the NO_CALLED_WITH_YET symbol sentinel. Thanks @​rbnayax. (#115, #116)

4.0.0

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.

Convert to TypeScript

  • feat: Convert jest-when to TypeScript with excellent type inference 5201c3e

... (truncated)

Commits
  • ee1c702 v4.0.3
  • 49c177a Add tests for preserving calledWith() registrations when setting defa… (#116)
  • 9e4d81f regression: .defaultImplementation() silently dropped prior bare .calledWith(...
  • 357e3d3 v4.0.2
  • 56299ba fix(types): resolve generic conditional return types (#114)
  • e7132bd 4.0.1
  • 710cee6 docs: refresh README and tighten published API surface
  • 70555be 4.0.0
  • 142f297 feat: Convert jest-when to TypeScript with excellent type inference (#111)
  • See full diff in compare view
Install script changes

This version adds prepare script that runs during installation. Review the package contents before updating.


Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Jun 12, 2026
@dependabot dependabot Bot changed the title build(deps-dev): bump jest-when from 3.7.0 to 4.0.3 chore(deps-dev): bump jest-when from 3.7.0 to 4.0.3 Jun 12, 2026
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/jest-when-4.0.3 branch from 37a0822 to d6338e4 Compare June 12, 2026 12:58
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/jest-when-4.0.3 branch from d6338e4 to 1e80683 Compare June 22, 2026 04:54
Bumps [jest-when](https://github.com/timkindberg/jest-when) from 3.7.0 to 4.0.3.
- [Release notes](https://github.com/timkindberg/jest-when/releases)
- [Commits](timkindberg/jest-when@v3.7.0...v4.0.3)

---
updated-dependencies:
- dependency-name: jest-when
  dependency-version: 4.0.3
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/jest-when-4.0.3 branch from 1e80683 to 8caa24a Compare June 29, 2026 08:23

This branch has not been deployed

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

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants