mock-browser icon indicating copy to clipboard operation
mock-browser copied to clipboard

new MockBrowser needs an option to set the document

Open bcowgill opened this issue 8 years ago • 1 comments

Been trying to write some code to test a document.location.protocol = file:

but the new MockBrowser always creates a document of a specific type with about:blank as the location. If you've already set up a window with a jsdom document in it, the MockBrowser should be able to use it.

propose new MockBrowser({ window: as created by jsdom document: window.location })

or internally, if you give a window you could use window.document as the document.

bcowgill avatar May 12 '16 13:05 bcowgill

created pull request#7 for this.

bcowgill avatar May 12 '16 14:05 bcowgill