始终 return 0 退出代码

Always return 0 exit code

当 运行 对我的 Cypress 进行测试时,我希望始终 return 退出代码 0。我 运行 这些测试是在我的发布部署之后进行的,所以当它 return 是一个非-零退出代码测试细节不报告到发布摘要。许多测试 运行ners 有一个配置选项来决定是否因错误而失败,所以我正在寻找那个选项。还没有看到类似的东西,所以请指点我那个方向。如果它不存在,我将打开一个功能请求。

谢谢!

试试这个:

// likely want to do this in a support file
// so it's applied to all spec files
// cypress/support/index.js

Cypress.on('uncaught:exception', (err, runnable) => {
  // returning false here prevents Cypress from
  // failing the test
  return false
})

/api/events/catalog-of-events.html#Uncaught-Exceptions