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

Using a default value does not update the whenified implementation #57

Closed
devzeebo opened this issue Jan 8, 2021 · 0 comments
Closed

Comments

@devzeebo
Copy link
Contributor

devzeebo commented Jan 8, 2021

Sample code:

const { when } = require('jest-when')

it('allows defining the default when NOT chaining', () => {
  const fn = jest.fn()

  when(fn).mockRejectedValue(false)

  when(fn)
    .calledWith(expect.anything())
    .mockResolvedValue(true)

  expect(fn()).rejects.toEqual(false)
});

Expectation: The test case to pass

timkindberg added a commit that referenced this issue Jan 8, 2021
Fix non-chained default implementations (fixes #57)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant