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

Fix wrong messages for nthCalledWith #6338

Closed
wants to merge 3 commits into from

Conversation

chinesedfan
Copy link
Contributor

Summary

formatMismatchedCalls prints the last x(usually x = 1) calls messages, but is not suitable for nthCalledWith.

Test plan

    it('sb', () => {
        const f = jest.fn();
        f(1, 1);
        f(2, 2);
        f(3, 3);
        expect(f).nthCalledWith(2, 4, 4);
    })

Before this fix, it prints the last call, which makes me very confused.

    Expected mock function second call to have been called with:
      4
    as argument 1, but it was called with
      3.
      4
    as argument 2, but it was called with
      3.

@SimenB
Copy link
Member

SimenB commented May 29, 2018

Can you add a test showing the behavior?

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants