Skip to content

Commit

Permalink
Display uncaught errors on the test results page
Browse files Browse the repository at this point in the history
This makes debugging in devices without a developer console easier.
  • Loading branch information
mislav committed Nov 15, 2016
1 parent 6f8529e commit 54ec096
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test.html
Expand Up @@ -7,6 +7,15 @@
</head>
<body>
<div id="mocha"></div>
<script>
window.onerror = function(err) {
var container = document.getElementById('mocha')
var el = document.createElement('p')
el.textContent = err.toString()
el.style = 'color:#c00'
container.insertBefore(el, container.firstChild)
}
</script>
<script src="/node_modules/url-search-params/build/url-search-params.js"></script>
<script src="/node_modules/chai/chai.js"></script>
<script src="/node_modules/mocha/mocha.js"></script>
Expand Down

0 comments on commit 54ec096

Please sign in to comment.