Add note about window.location.* #63
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Since you're on a file, there is no URI, and one should mock/stub, or use PhantomJS.
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.What library/code are you using that is working with
window.location
? I'd like to take a look.Oh sorry I wasn't clear. I tried to use
spyOn
and that obviously failed. I just need to read the value ofwindow.location.search
so I broke the first rule of the Mockist and moved it into a private method mocking its response.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.