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

mocha/test/browser/index.html doesn’t work properly in Firefox 10 #311

Closed
gamtiq opened this issue Mar 11, 2012 · 4 comments
Closed

mocha/test/browser/index.html doesn’t work properly in Firefox 10 #311

gamtiq opened this issue Mar 11, 2012 · 4 comments

Comments

@gamtiq
Copy link

gamtiq commented Mar 11, 2012

Hello,

For the unknown reason first browser tests from mocha/test/browser/index.html fail in Firefox 10.0.2.
All tests pass as expected in Chrome.

Best wishes,
Denis

@tj
Copy link
Contributor

tj commented Mar 11, 2012

haha, the stack traces are so bad in FF.. i'll look into it

@tj
Copy link
Contributor

tj commented Mar 11, 2012

it's saying there's a "location" variable leaking haha, seems like something the host must be doing, we use window.location once but that's it

@zoz
Copy link

zoz commented Mar 14, 2012

looks like FF exposes the 'location" global variable between the jquery ready event and the window.onload event. i.e. if I move mocha.run() from jquery.ready to window load the error goes away. (using FF 11)
P.S. I also had a problem with a third party lib "syn.js" exposing a global which I used mocha.run().globals(['__synthTest']) to remove the error. But what is interesting is that Chrome reports it as a leaked global while Firefox does not. I think its also a timing issue of when globals are introduced. I got rid of my global issues by doing the following:

$(window).load(function() {
  return setTimeout((function() {return mocha.run();}), 1);
});

@tj
Copy link
Contributor

tj commented Mar 15, 2012

hmm interesting, we could list location as a known global, not the greatest solution but at least we wont have a lot of confused people

@tj tj closed this as completed in 4ad8b5b Mar 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants