Open jpage-godaddy opened 2 weeks ago
Actually, this may be even simpler. It looks like in this test suite, someone erroneously made their test block an async function which I know is incorrect. Changing that fixes the issue. Maybe Cypress can detect if a Promise
is returned when running a test and tell the user that they should not be using an an async function.
Current behavior
I'm occasionally getting an error in my test suite. I have a
beforeEach
hook like this:...and sometimes I get a failure like this:
Clearly something else is going on because I am not doing what the error says I'm doing. It seems like an unhandled exception occurring in the prior test causing an error to be misidentified. If I skip the prior test, this does not occur.
Desired behavior
Cypress should show the actual unhandled exception
Test code to reproduce
I cannot reproduce in a minimal enough way to share the full code.
Cypress Version
13.15.1
Node version
20.18.0
Operating System
Ubuntu 22.04.4 LTS
Debug Logs
Other
I think the uncaught exception is due to an error being thrown in the browser after a previous test has completed, and that is being caught by the next test and erroneously associated with the currently executing command.