Fix tests for toEqual diff output in IE

- Merges #1236 from @benchristel
This commit is contained in:
Ben Christel
2016-11-20 12:12:37 -08:00
committed by Gregg Van Hove
parent 54e7a82ef3
commit 41a813521b
4 changed files with 47 additions and 8 deletions

View File

@@ -189,14 +189,24 @@ getJasmineRequireObj().matchersUtil = function(j$) {
var aIsElement = a instanceof Element;
var bIsElement = b instanceof Element;
if (aIsElement && bIsElement) {
return a.outerHTML == b.outerHTML;
result = a.outerHTML == b.outerHTML;
if (!result) {
diffBuilder.record(a, b);
}
return result;
}
if (aIsElement || bIsElement) {
diffBuilder.record(a, b);
return false;
}
return a.innerText == b.innerText && a.textContent == b.textContent;
result = a.innerText == b.innerText && a.textContent == b.textContent;
if (!result) {
diffBuilder.record(a, b);
}
return result;
}
if (aIsDomNode || bIsDomNode) {
diffBuilder.record(a, b);
return false;
}
@@ -363,7 +373,7 @@ getJasmineRequireObj().matchersUtil = function(j$) {
return 'Expected ' +
path + ' to be a kind of ' +
expected.constructor.name +
j$.fnNameFor(expected.constructor) +
', but was ' + j$.pp(actual) + '.';
}