Fix ObjectContaining to match recursively
matchersUtil.equals() does not expect a matcher as its first argument, so send the "actual" value first and the "expected" value second.
This commit is contained in:
@@ -18,7 +18,7 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||
if (!hasKey(other, property) && hasKey(this.sample, property)) {
|
||||
mismatchKeys.push('expected has key \'' + property + '\', but missing from actual.');
|
||||
}
|
||||
else if (!j$.matchersUtil.equals(this.sample[property], other[property])) {
|
||||
else if (!j$.matchersUtil.equals(other[property], this.sample[property])) {
|
||||
mismatchValues.push('\'' + property + '\' was \'' + (other[property] ? j$.util.htmlEscape(other[property].toString()) : other[property]) + '\' in actual, but was \'' + (this.sample[property] ? j$.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + '\' in expected.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user