How to use the coveralls.convertLcovToCoveralls function in coveralls

To help you get started, we’ve selected a few coveralls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github caitp / karma-coveralls / lib / index.js View on Github external
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);
          });
        });
      });
    }
github mmoulton / grunt-mocha-cov / lib / mocha.js View on Github external
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);
          });
        });
      });

coveralls

takes json-cov output into stdin and POSTs to coveralls.io

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis