Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
fix: don’t handle unhandled errors in cypress runner
Browse files Browse the repository at this point in the history
When the code is executed by the cypress test runner (i.e. the code were
tests are defined) we also don’t want to handle errors and show them to
the user. Instead they should be unhandled errors that make the tests
fail.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
  • Loading branch information
geigerzaehler committed Aug 16, 2021
1 parent 9e2d3c7 commit 86aa571
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/src/error.ts
Expand Up @@ -227,7 +227,13 @@ ipc.listenProxyError(proxyError => {
setFatal({ kind: FatalErrorKind.ProxyExit, data: proxyError });
});

if (!config.isCypressTestEnv && !config.isNodeTestEnv) {
// If we’re not in any kind of test environment we show unhandled
// errors to the user.
if (
!config.isCypressTestEnv &&
!config.isCypressTestRunner &&
!config.isNodeTestEnv
) {
window.addEventListener("unhandledrejection", ev => {
ev.preventDefault();
show(fromUnknown(ev.reason, Code.UnhandledRejection));
Expand Down

0 comments on commit 86aa571

Please sign in to comment.