javascript - How to check the value is in object with Chai? -
is possible test value contained within array chai assertion library?
example:
var myobject = { : 1, b : 2, c : 3 }; var myvalue = 2; i need (however not working):
expect(myobject).values.to.contain(myvalue); //error: cannot read property 'to' of undefined expect(myobject).to.contain(myvalue); //error: object #<object> has no method 'indexof' how can test this?
the chai fuzzy plugin has functionality needed.
var myobject = { : 1, b : 2, c : 3 }; var myvalue = 2; myobject.should.containonelike(myvalue);
Comments
Post a Comment