在测试我的页面时,依赖项会引发错误。该错误并不严重,不会干扰我的应用程序。但是当使用 puppeteer 进行测试时,出现此错误,他只是关闭了测试页面。如何防止这种情况继续测试而忽略此错误?
示例:
在页面上抛出此错误,测试以它结束。
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)
我的环境:
Puppeteer 版本:5.4.2
平台/操作系统版本:macOS 10.15.7
Node.js 版本:v12.16.1