Open stevenvachon opened 8 years ago
Hello?
Hey @stevenvachon sorry I missed this one.
Is this a feature request?
Chai itself already has assertions for looking into arrays, for example your first example could be:
chai.expect([ [1], [1] ]).to.all.contain(1)
Yes, a feature request. Interesting on all.contain()
-- I'll have to try that one out. But, how about array index ranges?
I'm using this with chai-like:
var obj = { key1:value, key2:value, key3:{key:value} };
expect([ obj, obj ]).to.all.be.like({ key1:value, key2:value });
expect([ [obj], [obj] ]).to.all.all.be.like({ key1:value, key2:value });
...
Nested Looping
but then, how would we handle 3+ levels deep?:
...but something less mathematical.
Ranged Looping
Synonyms
each
could also be a nice general synonym forall
.