visionmedia / page.js

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

Fix Context constructor references when a page instance is omitted #565

Open ChadKillingsworth opened 3 years ago

ChadKillingsworth commented 3 years ago

I was attempting to upgrade my version of Page.js, but encountered errors. Unit tests in my project create Context objects directly and those calls were failing. In particular, _page._getBase() is undefined when the Context object is constructed such as new page.Context('/some/path').

In my project, this isn't used in real code - just tests, but the fallback logic was clearly wrong too.

ChadKillingsworth commented 3 years ago

Oh one note - the build script didn't seem to build the page.mjs file. I had to manually change the output format in the rollup config for that to be built.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+1.2%) to 94.262% when pulling cb6b4826a49dfd22411c83672d9f1d9aa9522b7c on ChadKillingsworth:context-constructor into 4f9991658f9b9e3de9b6059bade93693af24d6bd on visionmedia:master.