| 32 | // Keep track of failed assertions for pretty-printing. |
| 33 | var failedAssertions = []; |
| 34 | var logFailedAssertions = function() { |
| 35 | var assertion; |
| 36 | // Print each assertion error. |
| 37 | while (assertion = failedAssertions.shift()) { |
| 38 | grunt.verbose.or.error(assertion.testName); |
| 39 | grunt.log.error('Message: ' + formatMessage(assertion.message)); |
| 40 | if (assertion.actual !== assertion.expected) { |
| 41 | grunt.log.error('Actual: ' + formatMessage(assertion.actual)); |
| 42 | grunt.log.error('Expected: ' + formatMessage(assertion.expected)); |
| 43 | } |
| 44 | if (assertion.source) { |
| 45 | grunt.log.error(assertion.source.replace(/ {4}(at)/g, ' $1')); |
| 46 | } |
| 47 | grunt.log.writeln(); |
| 48 | } |
| 49 | }; |
| 50 | |
| 51 | // QUnit hooks. |
| 52 | phantomjs.on('qunit.moduleStart', function(name) { |