page.js icon indicating copy to clipboard operation
page.js copied to clipboard

Fix Context constructor references when a page instance is omitted

Open ChadKillingsworth opened this issue 5 years ago • 2 comments

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 avatar Jul 10 '20 18:07 ChadKillingsworth

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.

ChadKillingsworth avatar Jul 10 '20 18:07 ChadKillingsworth

Coverage Status

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

coveralls avatar Jul 10 '20 18:07 coveralls