-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(expect): add toHaveBeenCalledExactlyOnceWith
expect matcher
#6894
feat(expect): add toHaveBeenCalledExactlyOnceWith
expect matcher
#6894
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks for picking this up! I didn't mention it in the issue, but probably we can just use Other than that, the code looks good to me 👍 |
Ah yeah, I was on the fence about naming, the more official doc I found suggested it should be |
…th to better fit in with the current ecosystem
toHaveBeenCalledOnceWith
expect matchertoHaveBeenCalledExactlyOnceWith
expect matcher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This is my first time putting a PR up on Github, how do I actually merge the PR now that it's approved and such? |
The exact process depends on project, but in our case, your change is a new feature, so we'll wait until next minor release. That's why I put it in 2.2.0 milestone https://github.com/vitest-dev/vitest/milestone/21 |
Description
This PR adds an
expect.toHaveBeenCalledOnceWith
method which asserts that a method has been called with the given arguments and has been called exactly once.This fixes #6849
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.