Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): bump jest-when and @types/jest-when #825

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Oct 21, 2024

Bumps jest-when and @types/jest-when. These dependencies needed to be updated together.
Updates jest-when from 3.3.1 to 3.6.0

Release notes

Sourced from jest-when's releases.

Support @​golevelup/ts-jest and jest-mock-extended proxies

  • v3.5.1 781bfce
  • Add .tool-versions for asdf 77cd461
  • Merge pull request #93 from mjgp2/issue-89 97b3725
  • fixes timkindberg/jest-when#89 562a35a

timkindberg/jest-when@v3.5.0...v3.5.1

Default Behavior Methods

New methods:

  • defaultReturnValue
  • defaultResolvedValue
  • defaultRejectedValue
  • defaultImplementation

Use them to set up a default behavior, which will serve as fallback if no matcher fits.

when(fn)
  .calledWith('foo').mockReturnValue('special')
  .defaultReturnValue('default') // This line can be placed anywhere, doesn't have to be at the end
expect(fn('foo')).toEqual('special')
expect(fn('bar')).toEqual('default')

Previously you needed to use any of mockReturnValue, mockResolvedValue, mockRejectedValue, or mockImplementation directly on the object before using calledWith to create a default fallback.

// Same as above example
when(fn)
  .mockReturnValue('default')
  .calledWith('foo').mockReturnValue('special')

One neat idea, and the reason I even did this work, is to set up a default implementation that throws an error if an improper call is made to the mock.

when(fn)
  .calledWith(correctArgs)
  .mockReturnValue(expectedValue)
  .defaultImplementation(unsupportedCallError)
// A default implementation that fails your test
function unsupportedCallError(...args) {
throw new Error(Wrong args: ${JSON.stringify(args, null, 2)});
}

Commits:

... (truncated)

Commits
  • 4476ba5 v3.6.0
  • bfac469 Merge pull request #106 from mircohacker/feature/add_full_stacktrace_to_error...
  • 5c227e8 Print full stack trace if verifyAllWhenMocksCalled fails
  • 647c968 Merge pull request #101 from benjaminjkraft/patch-1
  • 0b926b9 Remove a layer of indirection for defaultRejectedValue
  • 3ea3f71 Add files declaration to package.json
  • 767d84b v3.5.2
  • 0864485 Add tests for resolve/reject values without calledWith
  • 2b9858a Merge pull request #98 from 3y3/master
  • d849ccb Fix implementation function context
  • Additional commits viewable in compare view

Updates @types/jest-when from 2.7.2 to 3.5.5

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [jest-when](https://github.com/timkindberg/jest-when) and [@types/jest-when](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest-when). These dependencies needed to be updated together.

Updates `jest-when` from 3.3.1 to 3.6.0
- [Release notes](https://github.com/timkindberg/jest-when/releases)
- [Commits](timkindberg/jest-when@v3.3.1...v3.6.0)

Updates `@types/jest-when` from 2.7.2 to 3.5.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest-when)

---
updated-dependencies:
- dependency-name: jest-when
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: "@types/jest-when"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Oct 21, 2024
Copy link

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If you are the author and the PR has been closed, feel free to re-open the PR and continue the contribution!

@github-actions github-actions bot added the stale label Oct 28, 2024
@github-actions github-actions bot closed this Nov 2, 2024
Copy link
Author

dependabot bot commented on behalf of github Nov 2, 2024

OK, I won't notify you again about this release, but will get in touch when a new version is available. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/npm_and_yarn/multi-1ceb18d194 branch November 2, 2024 04:37
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 stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants