Skip to content
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

setTimeout doesn't seem to work #59

Open
ramseydsilva opened this issue Oct 6, 2013 · 3 comments · May be fixed by #123
Open

setTimeout doesn't seem to work #59

ramseydsilva opened this issue Oct 6, 2013 · 3 comments · May be fixed by #123
Labels

Comments

@ramseydsilva
Copy link

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

        client.eval(function() {
            Meteor.logout();
            Router.go("profile");
            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);
            done();
        });

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
Copy link

krstffr commented Nov 8, 2013

+1

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

@arunoda
Copy link
Owner

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
Copy link
Collaborator

apendua commented May 19, 2014

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

@apendua apendua linked a pull request May 24, 2014 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants