-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(expect): add Set support to toBeOneOf #8906
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
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
I would expect |
You can now pass a Set as an argument to toBeOneOf.
87e4fb8 to
bc6a946
Compare
@sheremet-va I changed the implementation to behave the exact same way as the array. No idea why there are 4 checks failing, is that to be expected at the moment or is this somehow caused by my changes? |
Description
This PR adds Set support to the
.toBeOneOfmethod.Resolves #8902
I find it quite strange that the test passes if the given array is empty. For consistency the Set implementation behaves the same. Is this really intentional? If so I would adjust the documentation. If not I can change it in a follow up PR.
Also I did not use the vitest internal equals method so something like
would fail. I don't think
toBeOneOfwill ever be used like that, therefore I just used the nativeSet.hasmethod. Does that work for you?Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.