I am trying to check an array of objects like:
[ { a: 1, b: 2, c: 3 }, { a: 4, b: 5, c: 6 }, ... ]
contains at least one object with { a: 1 } and { c: 3 } :
I thought I could do it with chai-things , but I donβt know all the properties of an object that can use
expect(array).to.include.something.that.deep.equals({ ??, a: 1, c: 3});
and contain.a.thing.with.property does not work with several properties: /
What is the best way to test something like this?
javascript mocha chai
usagidon
source share