(bool, message, context)
| 12 | var no = '<span style="color: rgb(180, 0, 0);">✘</span> ' |
| 13 | |
| 14 | function assert(bool, message, context) { |
| 15 | if (bool) stats.pass++; |
| 16 | if (!bool) stats.fail++; |
| 17 | stats.run++; |
| 18 | |
| 19 | message = '['+ context + '] ' + message; |
| 20 | |
| 21 | console.assert(bool, message); |
| 22 | asserts.push((bool ? yes : no) + message); |
| 23 | |
| 24 | report(); |
| 25 | } |
| 26 | |
| 27 | function report() { |
| 28 | document.getElementById('test-output').innerHTML = asserts.join('<br>'); |