No longer try to use nextTick since node.js gets upset
This commit is contained in:
@@ -1615,9 +1615,7 @@ getJasmineRequireObj().clearStack = function(j$) {
|
||||
}
|
||||
|
||||
function getClearStack(global) {
|
||||
if (global && global.process && j$.isFunction_(global.process.nextTick)) {
|
||||
return global.process.nextTick;
|
||||
} else if (j$.isFunction_(global.setImmediate)) {
|
||||
if (j$.isFunction_(global.setImmediate)) {
|
||||
var realSetImmediate = global.setImmediate;
|
||||
return function(fn) {
|
||||
realSetImmediate(fn);
|
||||
|
||||
@@ -7,20 +7,6 @@ describe("ClearStack", function() {
|
||||
});
|
||||
});
|
||||
|
||||
it("uses nextTick when available", function() {
|
||||
var nextTick = jasmine.createSpy('nextTick').and.callFake(function(fn) { fn() }),
|
||||
global = { process: { nextTick: nextTick } },
|
||||
clearStack = jasmineUnderTest.getClearStack(global),
|
||||
called = false;
|
||||
|
||||
clearStack(function() {
|
||||
called = true;
|
||||
});
|
||||
|
||||
expect(called).toBe(true);
|
||||
expect(nextTick).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("uses setImmediate when available", function() {
|
||||
var setImmediate = jasmine.createSpy('setImmediate').and.callFake(function(fn) { fn() }),
|
||||
global = { setImmediate: setImmediate },
|
||||
|
||||
@@ -18,9 +18,7 @@ getJasmineRequireObj().clearStack = function(j$) {
|
||||
}
|
||||
|
||||
function getClearStack(global) {
|
||||
if (global && global.process && j$.isFunction_(global.process.nextTick)) {
|
||||
return global.process.nextTick;
|
||||
} else if (j$.isFunction_(global.setImmediate)) {
|
||||
if (j$.isFunction_(global.setImmediate)) {
|
||||
var realSetImmediate = global.setImmediate;
|
||||
return function(fn) {
|
||||
realSetImmediate(fn);
|
||||
|
||||
Reference in New Issue
Block a user