Add note about window.location.* #63

Open
opened 2011-09-16 01:59:41 +00:00 by johnbintz · 4 comments
johnbintz commented 2011-09-16 01:59:41 +00:00 (Migrated from github.com)

Since you're on a file, there is no URI, and one should mock/stub, or use PhantomJS.

Since you're on a file, there is no URI, and one should mock/stub, or use PhantomJS.
lmarburger commented 2011-09-21 02:24:42 +00:00 (Migrated from github.com)

How might one stub/mock window.location.*? I'm playing with this now and it seems most things try to do window.location = function() {...} which makes webkit think it's leaving the page.

How might one stub/mock window.location.*? I'm playing with this now and it seems most things try to do `window.location = function() {...}` which makes webkit think it's leaving the page.
johnbintz commented 2011-09-21 02:48:04 +00:00 (Migrated from github.com)

What library/code are you using that is working with window.location? I'd like to take a look.

What library/code are you using that is working with `window.location`? I'd like to take a look.
lmarburger commented 2011-09-21 11:59:56 +00:00 (Migrated from github.com)

Oh sorry I wasn't clear. I tried to use spyOn and that obviously failed. I just need to read the value of window.location.search so I broke the first rule of the Mockist and moved it into a private method mocking its response.

Oh sorry I wasn't clear. I tried to use `spyOn` and that obviously failed. I just need to read the value of `window.location.search` so I broke the first rule of the Mockist and moved it into a private method mocking its response.
johnbintz commented 2011-09-21 17:11:04 +00:00 (Migrated from github.com)

Yeah, I usually end up taking one for the team when it comes to window.location anyway and wrap up any uses of it in some other function, then test for calls to that function. I live dangerously.

Yeah, I usually end up taking one for the team when it comes to `window.location` anyway and wrap up any uses of it in some other function, then test for calls to that function. I live dangerously.
Sign in to join this conversation.
No Label
bug
doc
feature
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: github-migration/jasmine-headless-webkit#63
No description provided.