blob: ed88ccde4f2d8d82944817529a8f6b55befa8740 [file] [log] [blame]
AviZi280f8012017-06-09 02:39:56 +03001var stdin = process.stdin;
2var inputJSON = '';
3var startJSON = false;
4stdin.resume();
5stdin.setEncoding('utf8');
6
7stdin.on('data', function (chunk) {
8 if (chunk.startsWith('{')) {
9 startJSON = true;
10 }
11 if (startJSON) {
12 inputJSON += chunk;
13 }
14});
15
16stdin.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) => {
talig8e9c0652017-12-20 14:30:43 +020025 if(suite.status === 'failed') {
AviZi280f8012017-06-09 02:39:56 +030026 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});