Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
coveralls.getBaseOptions(function(err, options) {
options.filepath = ".";
if ('repoToken' in coverallsReporter) options.repo_token = coverallsReporter.repoToken;
coveralls.convertLcovToCoveralls(input, options, function(err, postData) {
coveralls.sendToCoveralls(postData, function(err, response, body) {
log.info("uploading...");
send_to_coveralls(done, err, response, body);
});
});
});
}
opts.service_job_id = options.coveralls.serviceJobId;
}
if (options.coveralls.serviceName) {
opts.service_name = options.coveralls.serviceName;
}
if (options.coveralls.repoToken) {
opts.repo_token = options.coveralls.repoToken;
}
if (!(opts.repo_token || (opts.service_name && opts.service_job_id))) {
return callback(new Error('Unable to send data to coveralls.io, if you are not currently running on a supported CI service \'repoToken\' or \'serviceJobId\' and \'serviceName\' are required'));
}
coveralls.convertLcovToCoveralls(String(result), opts, function (err, postData) {
if (err) {
return callback(new Error('Unable to parse LCov coverage data: ' + err.message));
}
coveralls.sendToCoveralls(postData, function (err, response, body) {
if (err) {
return callback(new Error('Unable to send data to coveralls.io: ' + err.message));
}
if (response.statusCode >= 400) {
return callback(new Error('Bad response from coveralls.io: ' + response.statusCode + ' ' + body));
}
callback(null);
});
});
});