simonihmig / ember-window-mock

Mock window global in tests with test-friendly replacements for location, alert/confirm/prompt/ and more.
MIT License
64 stars 17 forks source link

Doc: Suggest beforeEach for all tests with QUnit global hooks? #560

Open nruth opened 7 months ago

nruth commented 7 months ago

It might be worth documenting this as a way of installing in an ember-cli app's test-helper.js Excessive perhaps, but does the localStorage gets reset if you forget to add this to each test file?

setupWindowMock(QUnit.hooks)

These were added in QUnit 2.18, so relatively recent.

https://api.qunitjs.com/QUnit/hooks/ https://github.com/qunitjs/qunit/releases/tag/2.18.0

simonihmig commented 1 month ago

Yeah, makes sense. @nruth would you be up for a PR? 😀