webaverse / xrpackage

XR (VR+AR) web object packaging core API
https://xrpackage.org/
24 stars 10 forks source link

Catch puppeteer evaluate errors for test suite #110

Closed shu8 closed 4 years ago

shu8 commented 4 years ago

This PR essentially wraps all the page functions used in the test suite around a try..catch so we can log the stack trace for errors in tests, making it easier to debug them.

To do this, it adds a safeEvaluate function to window which the page functions are now wrapped with, which just saves us from having to write the try... catch block for every single page function in each test.