-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 #1654
Conversation
Nice! It wasn't necessary to create a new Pull Request though, they get updated when you commit to the same branch. That way it's easier to keep up the conversation/discussion. :) |
I foolishly hadn't created a separate branch for the other PR, which is why I've created this new one. Should be good to go! 👍 |
Oh, my bad then. |
Doesn't this still give you a Also, commits should be squashed into a single one if they are part of the same change. |
I mean, if you check for |
Squashed commits, and added better checking so it should work in both cases. In my case, |
Cool, LGTM! Thanks for the PR 😄 However, it's breaking the build. |
@jakemmarsh Sorry, something is odd--there are updates to |
|
@@ -647,7 +647,7 @@ exports.stackTraceFilter = function() { | |||
: { browser: true } | |||
, cwd = is.node | |||
? process.cwd() + slash | |||
: location.href.replace(/\/[^\/]*$/, '/'); | |||
: ((typeof location === 'undefined') ? window.location : location).href.replace(/\/[^\/]*$/, '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that these double-brackets unnecessary here.
Any update on this fix? |
@jakemmarsh able to make the changes requested by @a8m? |
@boneskull made the updates and squashed to 1 commit! |
LGTM! |
@boneskull Is this ready to merge now? |
LGTM. Thanks for the PR, @jakemmarsh. :) |
fix 'location is not defined' error
This issue is still present in some wired environments. I ran into it in atom editor's Task today. In the context of atom task, |
I ran into this issue when running Relevant output:
|
I receive the error
ReferenceError: location is not defined
when running Mocha tests via Gulp. I'm using jsdom to mock thedocument
andwindow
, which is resulting in the globallocation
being undefined unless I explicitly doglobal.location = '{};
(or utilize this fix).Fix of PR #1653
CC @dasilvacontin