function getData(testName, reportPaths, callback) {
var testData = [];
var i = 0;
reportPaths.forEach((report) => {
getTestByName(report, testName, function(testInfo) {
if (!testData[report])
testData[report] = [];
testData[report].push(testInfo);
i++;
if (i === reportPaths.length){
callback(testData);
}
});
});
}
ZnVuY3Rpb24gZ2V0RGF0YSh0ZXN0TmFtZSwgcmVwb3J0UGF0aHMsIGNhbGxiYWNrKSB7Cgl2YXIgdGVzdERhdGEgPSBbXTsKCXZhciBpID0gMDsKCXJlcG9ydFBhdGhzLmZvckVhY2goKHJlcG9ydCkgPT4gewoJCWdldFRlc3RCeU5hbWUocmVwb3J0LCB0ZXN0TmFtZSwgZnVuY3Rpb24odGVzdEluZm8pIHsKCQkJaWYgKCF0ZXN0RGF0YVtyZXBvcnRdKQoJCQkJdGVzdERhdGFbcmVwb3J0XSA9IFtdOwoJCQl0ZXN0RGF0YVtyZXBvcnRdLnB1c2godGVzdEluZm8pOwoJCQlpKys7CgkJCWlmIChpID09PSByZXBvcnRQYXRocy5sZW5ndGgpewoJCQkJY2FsbGJhY2sodGVzdERhdGEpOwoJCQl9CgkJfSk7Cgl9KTsKfQ==