Closed deecewan closed 8 years ago
Hi @deecewan, "one of" is opposite to "containSubset", so you can write your test in different way:
var list = [{
name: "test1",
value: "abc",
},{
name: "test2",
value: "def"
}];
expect(list).to.containSubset([{name: "test1"}]);
If this is not that you need - then i would suggest you to write another plugin for chai and call it "oneOf". The purpose of 'chai-subset' is different.
yeah, i have found the Chai version. I was more wanting subset, because it allows for a subset of properties.
Thanks for getting back to me, tho.
If I am returned an array of 1 object, and there are two possible objects it could be, it'd be great to be able to check if one of the objects contains the subset.
For example,
list
can be one ofIf this is already there, that's awesome, but I can't find it.