Skip to content

Commit

Permalink
test: Fix secondary error thrown from unhandled errors (#7381)
Browse files Browse the repository at this point in the history
In #7345, we disabled Jasmine's global error handler. However, jasmine
still tries to call this. So instead of replacing it with null, replace
it with a stub.

Also add comments about why we are able to do this and still handle
global errors in our own way.
  • Loading branch information
joeyparrish authored Sep 26, 2024
1 parent c548315 commit 1db012d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,10 @@ function configureJasmineEnvironment() {
await loadNodeModules();

// Replace jasmine's global error handler, since we have our own more
// nuanced version.
window.onerror = null;
// nuanced version. You can't set this to null, since jasmine still tries
// to call it. Note also that our handler uses window.addEventListener
// instead of window.onerror.
window.onerror = () => {};
});

const originalSetTimeout = window.setTimeout;
Expand Down

0 comments on commit 1db012d

Please sign in to comment.