No longer try to use nextTick since node.js gets upset

This commit is contained in:
Gregg Van Hove
2017-04-25 14:38:09 -07:00
parent fbd2ffc08b
commit b771c083cb
3 changed files with 2 additions and 20 deletions

View File

@@ -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);

View File

@@ -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 },

View File

@@ -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);