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

fix 'location is not defined' error #1653

Closed
wants to merge 1 commit into from
Closed

fix 'location is not defined' error #1653

wants to merge 1 commit into from

Conversation

jakemmarsh
Copy link
Contributor

I receive the error ReferenceError: location is not defined when running Mocha tests via Gulp. I'm using jsdom to mock the document and window, which is resulting in the global location being undefined unless I explicitly do global.location = '{}; (or utilize this fix).

@dasilvacontin
Copy link
Contributor

When does this fail? Doesn't it by default get window.location?

@jakemmarsh
Copy link
Contributor Author

@dasilvacontin edited to explain when I get the error!

@boneskull
Copy link
Contributor

@jakemmarsh This looks fine to me; please rebase though.

@dasilvacontin
Copy link
Contributor

I hope it doesn't break with people that decided to go with the "explicitly do global.location = '{}';" route.

@dasilvacontin
Copy link
Contributor

Maybe (window.location || location) just to be sure. Until next major.

@jakemmarsh
Copy link
Contributor Author

Closing in favor of #1654

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

Successfully merging this pull request may close these issues.

3 participants