Chai offers a method called include
. I am looking to verify if one object includes another object. Take this example:
var source = {
name: "John",
additionalObj: {
type: "Sample"
}
}
With Chai, I want to confirm that this object contains the following (which it does)
var comparison = {
additionalObj: {
type: "Sample"
}
}
Attempting the following code doesn't seem to yield results:
source.should.include(comparison)