Closed koddsson closed 9 months ago
should we try support all iterables? may be possible by looking for Symbol.iterator
? 🤔
just wondering if we want it to support something which isn't a set or array but is iterable
I think supporting iterators generally is a good idea. Otherwise though this is a good step forward.
should we try support all iterables? may be possible by looking for
Symbol.iterator
? 🤔just wondering if we want it to support something which isn't a set or array but is iterable
I think supporting iterators generally is a good idea. Otherwise though this is a good step forward.
Yes! I wanted to change this:
to new Assertion(obj, flagMsg, ssfi, true).to.be.an('iterable');
but ran into issues so I'm coming back to it.
Something that I found is that string
has Symbol.iterator
so there might be some edge-cases.
I was gonna point this PR to #1592 but I guess I can't because it's on a different remote. In any case, I split out the iterable
assertion into it's own PR which I think we should merge first and then land this fix.
I think this is good but might benefit from more tests.
Fixes https://github.com/chaijs/chai/issues/1468
Add
Set
support tomembers
/sameMembers
. While doing that I want to introduce aiterable
assertion that I think could be useful.