Skip to content

Commit

Permalink
fix(debug-runner): support asynchronous tests in the debug runner
Browse files Browse the repository at this point in the history
Use console.error to log errors to the console instead of throwing
an error. This makes sure that errors are scoped properly for
asynchronous tests, instead of showing up as uncaught errors on
all asynchronous tests.

Fixes #2811
  • Loading branch information
daanstolp authored and dignifiedquire committed Aug 25, 2017
1 parent 523d608 commit a36f3eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/debug.js
Expand Up @@ -15,10 +15,10 @@ window.__karma__.result = window.console ? function (result) {
window.console.log(msg + result.suite.join(' ') + ' ' + result.description)

for (var i = 0; i < result.log.length; i++) {
// Throwing error without losing stack trace
// Printing error without losing stack trace
(function (err) {
setTimeout(function () {
throw err
window.console.error(err)
})
})(result.log[i])
}
Expand Down

0 comments on commit a36f3eb

Please sign in to comment.