Skip to content

setTimeout doesn't seem to work #59

ramseydsilva opened this Issue Oct 6, 2013 · 3 comments

4 participants


I try to delay emitting events in my tests, something like this:

        client.eval(function() {
            setTimeout(function() {
                emit('checkUrl', {
                    current_path: Router.current().path,
                    expected_path: Router.path("home")
            }, 5000);

        client.on('checkUrl', function(dict) {
            assert.equal(dict.current_path, dict.expected_path);

However it doesn't wait 5 minutes to emit. The test output shows it took about 1200ms and I get the undesired result for that test (as a result of not delaying the event).

I also tried using Meteor.setTimeout but the same issue.

krstffr commented Nov 8, 2013


It only works on the server as far as I'm concerned.

arunoda commented Feb 6, 2014

This is an issue with evaluating setTimeout inside PhantomJS. Seems like there is a hack to fix it. Give it a try: ariya/phantomjs#10832 (comment)

apendua commented May 19, 2014

@arunoda Do you think we could implement this patch into laika?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.