visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.68k stars 688 forks source link

Change test infrastructure to run inside of iframes #443

Closed matthewp closed 6 years ago

matthewp commented 6 years ago

This moves individual test to all run inside of iframes. This ensures that there is some level of isolation for tests and that you can run them in an actual browser and not just depend on jsdom.

This fixes #442

It also provides a new way to use an alternative to the main window by passing the window option when starting page.

page('/about', function(){

});

page({
  window: myIframe.contentWindow
})

In the future (probably post-2.0) I want to make it possible to have multiple Pages running at the same time, but for now this is what we'll have.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 89.759% when pulling 09fc51dbcf8bc22fd9a6ec1ac6787e00506550a8 on testsb into c9fe2951e5c2e11b4ec1fb6f5a0926c319b14e2e on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.0%) to 90.964% when pulling 08a46bdf1f4e94879490b039283cd49457b610ce on testsb into c9fe2951e5c2e11b4ec1fb6f5a0926c319b14e2e on master.