AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 1 | var stdin = process.stdin; |
| 2 | var inputJSON = ''; |
| 3 | var startJSON = false; |
| 4 | stdin.resume(); |
| 5 | stdin.setEncoding('utf8'); |
| 6 | |
| 7 | stdin.on('data', function (chunk) { |
| 8 | if (chunk.startsWith('{')) { |
| 9 | startJSON = true; |
| 10 | } |
| 11 | if (startJSON) { |
| 12 | inputJSON += chunk; |
| 13 | } |
| 14 | }); |
| 15 | |
| 16 | stdin.on('end', function () { |
| 17 | let report = JSON.parse(inputJSON); |
| 18 | if (!report.numFailedTestSuites) { |
| 19 | return; |
| 20 | } else { |
| 21 | console.log('--------------------------------'); |
| 22 | console.log('Failure Summary: \n'); |
| 23 | } |
| 24 | report.testResults.forEach((suite) => { |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 25 | if(suite.status === 'failed') { |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 26 | console.log('Suite: ' + suite.name); |
| 27 | suite.assertionResults.forEach((test) => { |
| 28 | if (test.status === 'failed') { |
| 29 | console.log('\tTest: ' + test.title); |
| 30 | } |
| 31 | }); |
| 32 | } |
| 33 | }); |
| 34 | }); |