Only clear resources if suite is not disabled

[#66789174]
This commit is contained in:
Christopher Amavisca and Greg Cobb
2014-03-05 14:00:57 -08:00
parent 752a36d3ff
commit b200952195
7 changed files with 363 additions and 139 deletions

View File

@@ -22,11 +22,11 @@ getJasmineRequireObj().Env = function(j$) {
var currentSuite = function() {
return currentlyExecutingSuites[currentlyExecutingSuites.length - 1];
}
};
var currentRunnable = function() {
return currentSpec || currentSuite();
}
};
var reporter = new j$.ReportDispatcher([
'jasmineStarted',
@@ -217,8 +217,10 @@ getJasmineRequireObj().Env = function(j$) {
queueRunner: queueRunnerFactory,
onStart: suiteStarted,
resultCallback: function(attrs) {
clearResourcesForRunnable(suite.id);
currentlyExecutingSuites.pop();
if (!suite.disabled) {
clearResourcesForRunnable(suite.id);
currentlyExecutingSuites.pop();
}
reporter.suiteDone(attrs);
}
});

View File

@@ -51,7 +51,7 @@ getJasmineRequireObj().MockDate = function() {
if (GlobalDate.now) {
return currentTime;
} else {
throw new Error("Browser does not support Date.now()");
throw new Error('Browser does not support Date.now()');
}
};

View File

@@ -1,7 +1,7 @@
getJasmineRequireObj().SpyRegistry = function(j$) {
function SpyRegistry(options) {
var options = options || {};
options = options || {};
var currentSpies = options.currentSpies || function() { return []; };
this.spyOn = function(obj, methodName) {
@@ -43,4 +43,3 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
return SpyRegistry;
};

View File

@@ -31,7 +31,7 @@ getJasmineRequireObj().util = function() {
};
util.clone = function(obj) {
if (Object.prototype.toString.apply(obj) === "[object Array]") {
if (Object.prototype.toString.apply(obj) === '[object Array]') {
return obj.slice();
}
@@ -43,7 +43,7 @@ getJasmineRequireObj().util = function() {
}
return cloned;
}
};
return util;
};