mock-browser
mock-browser copied to clipboard
new MockBrowser needs an option to set the document
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.
created pull request#7 for this.