Chai has a nice way to assert if an Array includes a certain element
expect([1,2,3]).to.include(2);
What I would like is something similar, given an Array of Objects:
expect([{a:1},{b:2}]).to.include({b:2});
Is this possible?
Take a look at the Chai Things plugin, that does what you want:
[{a:1},{b:2}].should.include.something.that.deep.equals({b:2})