-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jasmine.Clock broken in node.js #171
Comments
I have the same problem. |
I'm hitting this too. |
Indeed, I worked around this by re-assigning the var oldSetTimeout, timeWaited;
beforeEach(function() {
oldSetTimeout = setTimeout;
timeWaited = 0;
setTimeout = function(callback, timeout) {
timeWaited += timeout;
callback(); // FIXME handle callback passed as String
};
});
afterEach(function() { setTimeout = oldSetTimeout; }); |
this is in my spec helper. it solves the problem jasmine.getGlobal = function() { return GLOBAL; } jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
if (jasmine.Clock.installed.setTimeout.apply) {
return jasmine.Clock.installed.setTimeout.apply(this, arguments);
} else {
return jasmine.Clock.installed.setTimeout(funcToCall, millis);
}
}; and so on. All 4 lines from jasmine.js |
Temporarily solved with SinonJS fake timers which could be used separately. |
I've got this fixed in a new beta, I'll push it up here after 1.1.1 is released. |
Ready for publish. Currently in 1.2.0 branch. |
Whoot! Drinks on me if we ever meetup somewhere :) |
Hah. I'll hold you to that! Have you verified? It works in my tests,knowing it works somewhere else would be awesome. |
No, but I'll try and get it in early this week and let you know. |
Awesome, thanks! |
Just updated and it works perfectly! I removed all the |
Fantastic! Glad to hear it. |
Thank you for the fix - but I am still having issues. See https://gist.github.com/mainiak/4355050 Line below will fail. Seems like clearInterval isn't working. git clone https://gist.github.com/4355050.git && cd 4355050 && patch -i nodejs.patch && jasmine-node --coffee --verbose . |
I am still having the issue above form @mainiak |
Seems related to this google groups thread
Running this example from pivotal.github.com/jasmine fails:
The text was updated successfully, but these errors were encountered: