Open radekn opened 8 years ago
Hey!
You mean something like Array.prototype.some
? I've thought of something like it, akin to the "middleware" thing that Must.prototype.then
is — allow you to call foo.must.have.some.eql({name: "John"})
or equivalent.
Yes, having something like this would be awesome :)
I stumbled once into a use case that seems not to be covered by
must
- to assert that a collection (object or array) contains a value satifsying a specific condition.There is
includes
matcher, but it only checks for strict equality, so I couldn't use it. I think I ended up using Lodash to find the element, and then usedexist
matcher on the result. It worked well, but left me with the feeling that it would be much nicer (more concise and idiomatic) if I could do it directly with the assertion library.Any thoughts?