You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if Cypress errors out and does not run the test (which can happen due to misconfiguration, wrong arguments, failing to record, etc) it does not preserve the error - nor does it make it accessible via the module API.
constcypress=require('cypress')constdidRunError=(results)=>{returnresults.message&&results.message.includes('Could not find Cypress test run results')}// run using our module APIcypress.run().then((results={})=>{if(didRunError(results)){// do your fallback behavior here}})
Currently if Cypress errors out and does not run the test (which can happen due to misconfiguration, wrong arguments, failing to record, etc) it does not preserve the error - nor does it make it accessible via the module API.
Currently when using the module API and an error occurs, we have fallback code in the CLI here: https://github.com/cypress-io/cypress/blob/master/cli%2Flib%2Fcypress.js#L31 which resolves with a pretty useless object.
Instead, we should actually
reject
the underlying promise and rehydrate the error instance that caused Cypress to abandon running the tests.Here's an issue for reference: #4021
The text was updated successfully, but these errors were encountered: