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

enhancement: 'to have items satisfying' #44

Closed
boneskull opened this issue Aug 24, 2020 · 1 comment
Closed

enhancement: 'to have items satisfying' #44

boneskull opened this issue Aug 24, 2020 · 1 comment

Comments

@boneskull
Copy link
Contributor

boneskull commented Aug 24, 2020

It'd be handy to be able to express "every item in the set should satisfy assertion" (like the core "array" assertion), which I don't think is currently possible.

e.g.:

const set = new Set(['foo', 'bar', 'baz']);
expect(set, 'to have items satisfying', expect.it('to have length', 3));
@papandreou
Copy link
Member

You're in luck! <Set> to have items satisfying <assertion> has been implemented since the initial commit :)

It has been undocumented until 18 days ago (#37), though, and it looks like we forgot to update the documentation site after it landed. But here it is: https://unexpected.js.org/unexpected-set/assertions/Set/to-have-items-satisfying/ 🤗

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

2 participants