You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 used exist 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?
The text was updated successfully, but these errors were encountered:
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.
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?
The text was updated successfully, but these errors were encountered: