diff options
Diffstat (limited to 'openecomp-ui/test-utils/failedTestReport.js')
-rw-r--r-- | openecomp-ui/test-utils/failedTestReport.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/openecomp-ui/test-utils/failedTestReport.js b/openecomp-ui/test-utils/failedTestReport.js new file mode 100644 index 0000000000..9520cc9c99 --- /dev/null +++ b/openecomp-ui/test-utils/failedTestReport.js @@ -0,0 +1,34 @@ +var stdin = process.stdin; +var inputJSON = ''; +var startJSON = false; +stdin.resume(); +stdin.setEncoding('utf8'); + +stdin.on('data', function (chunk) { + if (chunk.startsWith('{')) { + startJSON = true; + } + if (startJSON) { + inputJSON += chunk; + } +}); + +stdin.on('end', function () { + let report = JSON.parse(inputJSON); + if (!report.numFailedTestSuites) { + return; + } else { + console.log('--------------------------------'); + console.log('Failure Summary: \n'); + } + report.testResults.forEach((suite) => { + if(suite.status == 'failed') { + console.log('Suite: ' + suite.name); + suite.assertionResults.forEach((test) => { + if (test.status === 'failed') { + console.log('\tTest: ' + test.title); + } + }); + } + }); +}); |