New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

comforter-cli

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comforter-cli - npm Package Compare versions

Comparing version

to
0.4.8

30

lib/index.js

@@ -5,3 +5,3 @@ #! /usr/bin/env node

var chalk = require('chalk');
var restler = require('restler');
var request = require('request');
var fs = require('fs');

@@ -65,4 +65,3 @@ var targz = require('tar.gz');

try {
var size = fs.statSync(argv.path).size;
data.lcov = restler.file(argv.path, 'lcov.info', size);
data.lcov = fs.createReadStream(argv.path);
} catch (err) {

@@ -97,5 +96,3 @@ fail(errors.lcovFile, err);

}
var zipSize = fs.statSync('coverage.zip').size;
data.zip = restler.file('coverage.zip', 'coverage.zip', zipSize);
data.zip = fs.createReadStream('coverage.zip');
deferred.resolve();

@@ -115,15 +112,12 @@ });

// send multi-part request
restler.post(argv.host + 'api/apps/' + argv.project + '/coverage?apiKey=' + data.apiKey, {
multipart: true,
data: data
})
var config = {
url: argv.host + 'api/apps/' + argv.project + '/coverage?apiKey=' + data.apiKey,
formData: data
};
// successful upload
.on('success', function (data) {
console.log('Comforter Coverage: ' + chalk.green(data.coverage));
})
// network failure or other issue with the request
.on('error', fail.bind(null, errors.network))
.on('fail', fail.bind(null, errors.badRequest));
request.post(config, function (err, response, body) {
if (err) return fail.bind(null, errors.network);
if (response.statusCode >= 400) return fail.bind(null, errors.badRequest);
console.log('Comforter Coverage: ' + chalk.green(body.coverage));
});
})

@@ -130,0 +124,0 @@ .catch(fail.bind(null, errors.badRequest));

4

package.json
{
"name": "comforter-cli",
"version": "0.4.7",
"version": "0.4.8",
"description": "cli tool for communicating with comforter instance",

@@ -29,3 +29,3 @@ "scripts": {

"q": "^1.4.1",
"restler": "^3.4.0",
"request": "^2.88.0",
"rimraf": "^2.5.0",

@@ -32,0 +32,0 @@ "tar.gz": "^1.0.2"

@@ -36,3 +36,3 @@ 'use strict';

code.expect(err).to.exist();
code.expect(err.toString()).to.contain('LCOV file could not be found');
code.expect(err.toString()).to.contain('ENOENT');
done(); // dont pass err cuz we are expecting err

@@ -39,0 +39,0 @@ });