puppeteer 在出错后关闭页面
The puppeteer closes the page after an error
在测试我的页面时,从依赖项中抛出错误。该错误并不严重,不会影响我的应用程序。但是当用木偶操纵者进行测试时,出现这个错误,他只是关闭了测试页面。我怎样才能阻止它继续测试而忽略这个错误?
示例:
页面抛出此错误,测试至此结束
Error: TypeError: Cannot set property 'paddingLeft' of undefined
at FrozenColumns.layoutRow (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:16595:26)
at Row.initialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:5313:37)
at Row.reinitialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:5376:8)
at eval (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:4415:7)
at Array.forEach (<anonymous>)
at RowManager.reinitialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:4414:12)
at ColumnManager.redraw (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:1206:25)
at RowManager.refreshActiveData (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:3668:31)
at RowManager.sorterRefresh (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:3482:8)
at HTMLDivElement.eval (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:22644:27)
我的环境:
人偶版本:5.4.2
平台/OS 版本:macOS 10.15.7
Node.js版本:v12.16.1
使用jest-puppeteer时,可以在jest-puppeteer.config.js中指定exitOnPageError: false参数。在这种情况下,如果页面出现错误,测试将不会完成。
在测试我的页面时,从依赖项中抛出错误。该错误并不严重,不会影响我的应用程序。但是当用木偶操纵者进行测试时,出现这个错误,他只是关闭了测试页面。我怎样才能阻止它继续测试而忽略这个错误?
示例:
页面抛出此错误,测试至此结束
Error: TypeError: Cannot set property 'paddingLeft' of undefined
at FrozenColumns.layoutRow (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:16595:26)
at Row.initialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:5313:37)
at Row.reinitialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:5376:8)
at eval (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:4415:7)
at Array.forEach (<anonymous>)
at RowManager.reinitialize (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:4414:12)
at ColumnManager.redraw (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:1206:25)
at RowManager.refreshActiveData (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:3668:31)
at RowManager.sorterRefresh (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:3482:8)
at HTMLDivElement.eval (webpack-internal:///./node_modules/react-tabulator/node_modules/tabulator-tables/dist/js/tabulator.es2015.js:22644:27)
我的环境:
人偶版本:5.4.2
平台/OS 版本:macOS 10.15.7
Node.js版本:v12.16.1
使用jest-puppeteer时,可以在jest-puppeteer.config.js中指定exitOnPageError: false参数。在这种情况下,如果页面出现错误,测试将不会完成。