Use jasmineToString for printing out complicated matchers
This commit is contained in:
@@ -365,7 +365,7 @@ jasmine.Matchers.Any.prototype.matches = function(other) {
|
||||
return other instanceof this.expectedClass;
|
||||
};
|
||||
|
||||
jasmine.Matchers.Any.prototype.toString = function() {
|
||||
jasmine.Matchers.Any.prototype.jasmineToString = function() {
|
||||
return '<jasmine.any(' + this.expectedClass + ')>';
|
||||
};
|
||||
|
||||
|
||||
@@ -23,10 +23,8 @@ jasmine.PrettyPrinter.prototype.format = function(value) {
|
||||
this.emitScalar('null');
|
||||
} else if (value === jasmine.getGlobal()) {
|
||||
this.emitScalar('<global>');
|
||||
} else if (value instanceof jasmine.Matchers.Any) {
|
||||
this.emitScalar(value.toString());
|
||||
} else if (value instanceof jasmine.Matchers.ObjectContaining) {
|
||||
this.emitScalar(value.toString());
|
||||
} else if (value.hasOwnProperty("jasmineToString")) {
|
||||
this.emitScalar(value.jasmineToString());
|
||||
} else if (typeof value === 'string') {
|
||||
this.emitString(value);
|
||||
} else if (jasmine.isSpy(value)) {
|
||||
|
||||
Reference in New Issue
Block a user