chore: fix js tests
This commit is contained in:
parent
40d0095b3c
commit
aa25867517
1 changed files with 15 additions and 13 deletions
|
@ -123,21 +123,23 @@
|
||||||
<div id="mocha"></div>
|
<div id="mocha"></div>
|
||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
<script>
|
<script>
|
||||||
var runner = (window.mochaPhantomJS || window.mocha).run(function (failures) {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
if (window.location.search.indexOf('debug') === -1)
|
var runner = (window.mochaPhantomJS || window.mocha).run(function (failures) {
|
||||||
qs('#mocha').style.display = 'block'
|
if (window.location.search.indexOf('debug') === -1)
|
||||||
console.log(failures)
|
qs('#mocha').style.display = 'block'
|
||||||
})
|
console.log(failures)
|
||||||
if (window.location.search.indexOf('debug') !== -1) {
|
|
||||||
runner.on('fail', function (test, err) {
|
|
||||||
console.log(test.title, test.err)
|
|
||||||
console.log(test.err.expected, test.err.actual)
|
|
||||||
console.log(test.err.stack)
|
|
||||||
})
|
})
|
||||||
sinon.log = function (message) {
|
if (window.location.search.indexOf('debug') !== -1) {
|
||||||
console.log(message)
|
runner.on('fail', function (test, err) {
|
||||||
|
console.log(test.title, test.err)
|
||||||
|
console.log(test.err.expected, test.err.actual)
|
||||||
|
console.log(test.err.stack)
|
||||||
|
})
|
||||||
|
sinon.log = function (message) {
|
||||||
|
console.log(message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue