Don't keep the expected and actual for a passed expectation
- It causes memory problems in phantom and you probably don't need it anyways. Fixes #640 Fixes #690
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1411,15 +1411,20 @@ getJasmineRequireObj().buildExpectationResult = function() {
|
|||||||
var messageFormatter = options.messageFormatter || function() {},
|
var messageFormatter = options.messageFormatter || function() {},
|
||||||
stackFormatter = options.stackFormatter || function() {};
|
stackFormatter = options.stackFormatter || function() {};
|
||||||
|
|
||||||
return {
|
var result = {
|
||||||
matcherName: options.matcherName,
|
matcherName: options.matcherName,
|
||||||
expected: options.expected,
|
|
||||||
actual: options.actual,
|
|
||||||
message: message(),
|
message: message(),
|
||||||
stack: stack(),
|
stack: stack(),
|
||||||
passed: options.passed
|
passed: options.passed
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(!result.passed) {
|
||||||
|
result.expected = options.expected;
|
||||||
|
result.actual = options.actual;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
function message() {
|
function message() {
|
||||||
if (options.passed) {
|
if (options.passed) {
|
||||||
return 'Passed.';
|
return 'Passed.';
|
||||||
|
|||||||
@@ -4,15 +4,20 @@ getJasmineRequireObj().buildExpectationResult = function() {
|
|||||||
var messageFormatter = options.messageFormatter || function() {},
|
var messageFormatter = options.messageFormatter || function() {},
|
||||||
stackFormatter = options.stackFormatter || function() {};
|
stackFormatter = options.stackFormatter || function() {};
|
||||||
|
|
||||||
return {
|
var result = {
|
||||||
matcherName: options.matcherName,
|
matcherName: options.matcherName,
|
||||||
expected: options.expected,
|
|
||||||
actual: options.actual,
|
|
||||||
message: message(),
|
message: message(),
|
||||||
stack: stack(),
|
stack: stack(),
|
||||||
passed: options.passed
|
passed: options.passed
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(!result.passed) {
|
||||||
|
result.expected = options.expected;
|
||||||
|
result.actual = options.actual;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
function message() {
|
function message() {
|
||||||
if (options.passed) {
|
if (options.passed) {
|
||||||
return 'Passed.';
|
return 'Passed.';
|
||||||
|
|||||||
Reference in New Issue
Block a user