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

A mock browser with window, document, location, navigation, local and session storage to use for client side code tests in a node environment.

Results 15 mock-browser issues
Sort by recently updated
recently updated
newest added

I have an angular app which server side renders my app. Problem is - my app uses jquery so the server goes crazy with errors (`ERROR ReferenceError: $ is not...

Is it possible to provide a version that runs in the browser? [Mocha](https://mochajs.org/#running-mocha-in-the-browser) and [sinon e.g.](https://unpkg.com/[email protected]/pkg/sinon.js) provide such versions.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset

Please update them: * https://david-dm.org/darrylwest/mock-browser

I need some property or function below, hope to support canvasElem.arc, canvasElem.stroke, canvasElem.fillRect, canvasElem.fillText, for screen properties, hope random value support

does/can mock-browser provide support for WebSocket?

is there any support for add `document.styleSheets` ?

I tried mocking location object but i get the following error. `var url = window.location.href.replace(/\/$/, '');` TypeError: Cannot read property 'replace' of undefined Any suggestions? Thank you in advance!

[Referenced here](https://github.com/facebook/jest/issues/2441) - looks like setting this up for my tests clobbers the available `global` in node. `console.log` no longer works and the properties I've added to `global` (APP_CONFIG, etc.)...

Maybe this is a question to ask jsdom, but I'm wondering can you utilize the WebRTC API (https://webrtc.org/) It's supported by most major browsers.