| 1 | |
| 2 | /*global doh: false, process: false */ |
| 3 | |
| 4 | var aps = Array.prototype.slice; |
| 5 | |
| 6 | doh.debug = function () { |
| 7 | //Could have multiple args, join them all together. |
| 8 | var msg = aps.call(arguments, 0).join(' '); |
| 9 | console.log(msg); |
| 10 | }; |
| 11 | |
| 12 | // Override the doh._report method to make it quit with an |
| 13 | // appropriate exit code in case of test failures. |
| 14 | var oldReport = doh._report; |
| 15 | doh._report = function () { |
| 16 | oldReport.apply(doh, arguments); |
| 17 | if (this._failureCount > 0 || this._errorCount > 0) { |
| 18 | process.exit(1); |
| 19 | } |
| 20 | }; |