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

[Feature]: Chain nthCalledWith #13675

Closed
wants to merge 1 commit into from

Conversation

feliperli
Copy link
Contributor

Summary

This add a new matcher toBeNth to be used when the function you want to test have no arguments for better understanding of the reader. This was requested at this issue #13646

Test plan

test('works with arguments that match', () => {
    const fn = jest.fn();
    fn(1);

    jestExpect(createSpy(fn))[calledWith](1);
    jestExpect(fn)[calledWith](1);

    expect(() => jestExpect(fn)[calledWith](1)).not.toThrow();
  });

@SimenB
Copy link
Member

SimenB commented Jan 3, 2023

Thanks for the PR! However, I don't think we need to add this to core. I'd be happy to land this in https://github.com/jest-community/jest-extended 🙂

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

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 Feb 3, 2023
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