page.js
page.js copied to clipboard
Fix Context constructor references when a page instance is omitted
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.
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.