I am trying to write some tests that call window.document, and I want to mock out the actual calls themselves, so I can run them headless. Bu the following code won't work:
window = {"document": ""};
document = window.document;
document.cookie = "";
document.location = {"hostname": "test.myserver.com"}
I get the following error:
TypeError: Cannot set property window that has only a getter. in file:...
Does anyone have any idea how to mock this out?
I am using Jasmine, and the jasmine-maven-plugin if that makes any difference.