Skip to content

Commit

Permalink
Handle browser-side errors in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed Feb 15, 2020
1 parent fe14327 commit 5c10827
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ window.addEventListener('unhandledrejection', function (ev) {
done(ev.reason);
});

window.onerror = function (message, source, lineno, colno, err) {
done(err);
};

console.log = function () { // eslint-disable-line no-console
process.stdout.write(util.format.apply(this, arguments));
process.stdout.write(os.EOL);
Expand Down

0 comments on commit 5c10827

Please sign in to comment.