-
-
Notifications
You must be signed in to change notification settings - Fork 701
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
.members should work with ES6 Sets/WeakSets #1096
Comments
For WeakSets it's the same. const x = { t: 1 },
y = { t: 2 },
z = { t: 3 };
expect(new WeakSet([x, y, z])).to.have.members([x, y, z]); |
And just for anybody else that gets here the workaround is using expect(Array.from(new Set([1, 2, 3]))).to.have.members([2, 1, 3]); |
@rijnhard It makes sense to me that expect(new Set([1, 2, 3])).to.have.keys([2, 1, 3]);
expect(new Set([{a: 1}])).to.have.deep.keys([{a: 1}]); |
Hey @rijnhard thanks for the issue. This would be awesome! We've added this to our Roadmap https://github.com/chaijs/chai/projects/2! We'll be releasing chai 5 soon, but for now I'll close this issue because it is tracked on our roadmap. |
Similar to #632
An ES6 Set should work with the members function just like an array.
Pass conditions
Fail conditions should eb the exact same as that of arrays.
The text was updated successfully, but these errors were encountered: