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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -