Test asynchronous parts of Jasmine asynchronously

This commit is contained in:
Davis W. Frank and Sheel Choksi
2013-07-02 12:09:48 -07:00
parent f5bc9faf63
commit dcf7a0867e
7 changed files with 220 additions and 166 deletions

View File

@@ -7,7 +7,7 @@ getJasmineRequireObj().Env = function(j$) {
var catchExceptions = true;
var realSetTimeout = global.setTimeout;
var realSetTimeout = j$.getGlobal().setTimeout;
this.clock = new j$.Clock(global, new j$.DelayedFunctionScheduler());
this.spies_ = [];
@@ -111,7 +111,7 @@ getJasmineRequireObj().Env = function(j$) {
function clearStack(fn) {
currentSpecCallbackDepth++;
if (currentSpecCallbackDepth > maximumSpecCallbackDepth) {
if (currentSpecCallbackDepth >= maximumSpecCallbackDepth) {
currentSpecCallbackDepth = 0;
realSetTimeout(fn, 0);
} else {

View File

@@ -5,7 +5,7 @@ getJasmineRequireObj().Suite = function() {
this.parentSuite = attrs.parentSuite;
this.description = attrs.description;
this.onStart = attrs.onStart || function() {};
this.completeCallback = attrs.completeCallback || function() {};
this.completeCallback = attrs.completeCallback || function() {}; // TODO: this is unused
this.resultCallback = attrs.resultCallback || function() {};
this.clearStack = attrs.clearStack || function(fn) {fn();};