Merge branch 'promise-matching-1314' of https://github.com/sderickson/jasmine
This commit is contained in:
@@ -87,6 +87,10 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||
return obj.nodeType > 0;
|
||||
};
|
||||
|
||||
j$.isPromise = function(obj) {
|
||||
return typeof jasmineGlobal.Promise !== 'undefined' && obj.constructor === jasmineGlobal.Promise;
|
||||
};
|
||||
|
||||
j$.fnNameFor = function(func) {
|
||||
if (func.name) {
|
||||
return func.name;
|
||||
|
||||
@@ -213,6 +213,12 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
||||
diffBuilder.record(a, b);
|
||||
return false;
|
||||
}
|
||||
|
||||
var aIsPromise = j$.isPromise(a);
|
||||
var bIsPromise = j$.isPromise(b);
|
||||
if (aIsPromise && bIsPromise) {
|
||||
return a === b;
|
||||
}
|
||||
|
||||
// Assume equality for cyclic structures. The algorithm for detecting cyclic
|
||||
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
|
||||
|
||||
Reference in New Issue
Block a user