Make toEqual matcher report the difference between objects
- Mismatches deep within object/array structures are pinpointed with a JsonPath-like syntax.
This commit is contained in:
committed by
Ben Christel
parent
5a76e59d5b
commit
d5e6bf47ed
@@ -145,7 +145,13 @@ getJasmineRequireObj().pp = function(j$) {
|
||||
};
|
||||
|
||||
StringPrettyPrinter.prototype.emitObject = function(obj) {
|
||||
var constructorName = obj.constructor ? j$.fnNameFor(obj.constructor) : 'null';
|
||||
var ctor = obj.constructor,
|
||||
constructorName;
|
||||
|
||||
constructorName = typeof ctor === 'function' && obj instanceof ctor ?
|
||||
j$.fnNameFor(obj.constructor) :
|
||||
'null';
|
||||
|
||||
this.append(constructorName);
|
||||
|
||||
if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) {
|
||||
|
||||
Reference in New Issue
Block a user