Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
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
0.4.3
to
0.4.4
+4
-3
.gitlab-ci.yml
before_script:
- . /opt/.nvm/nvm.sh
- nvm use stable
- npm install
- source /usr/local/nvm/nvm.sh
- nvm install v6.12.0
- nvm use v6.12.0
- npm i
cache:

@@ -6,0 +7,0 @@ untracked: true

@@ -47,2 +47,10 @@ #! /usr/bin/env node

if (argv['merge-base']) {
data.mergeBase = argv['merge-base'];
}
if (argv['target-branch']) {
data.targetBranch = argv['target-branch'];
}
var deferred = q.defer();

@@ -114,3 +122,4 @@

.on('fail', fail.bind(null, errors.badRequest));
});
})
.catch(fail.bind(null, errors.badRequest));

@@ -133,3 +142,3 @@ }

}
if (!params.project || !params.branch || !params.commit || !params.host || !params.apiKey) {
if (!params.project || !params.branch || !params.commit || !params.host || !params.apiKey || !params.name) {
fail(errors.missingRequiredParams);

@@ -136,0 +145,0 @@ }

{
"name": "comforter-cli",
"version": "0.4.3",
"version": "0.4.4",
"description": "cli tool for communicating with comforter instance",
"scripts": {
"test": "jshint --reporter=node_modules/jshint-stylish lib/*.js test/ && jscs lib/ test/ && lab -v"
"test": "jshint --reporter=node_modules/jshint-stylish lib/*.js test/ && jscs lib/ test/ && lab -v --leaks"
},

@@ -8,0 +8,0 @@ "bin": {

@@ -7,5 +7,5 @@ ## Comforter CLI tool

`npm install -g comforter-cli`
`comforter-cli (--path <path-to-lcov-info-file> OR --totalLines <lines> --totalCovered <lines>) --name <project-name> --branch <branch-name> --project <project-id> --commit <sha> --apiKey <key> [--zip <path-to-html-coverage>]`
`comforter-cli (--path <path-to-lcov-info-file> OR --totalLines <lines> --totalCovered <lines>) --name <project-name> --branch <branch-name> --project <project-id> --commit <sha> [--merge-base <sha>] [--target-branch <branch name>] --apiKey <key> [--zip <path-to-html-coverage>]`
* [x] Accept path to generated coverage html and zip and send to Comforter
* [ ] Use `npm cli` to avoid running tests in exec, allowing coverage and better testing (see [jshint](https://github.com/jshint/jshint) repo for examples)
'use strict';
var lab = exports.lab = require('lab').script();
var code = require('code');
var child = require('child_process');
var path = require('path');
var fs = require('fs-extra');
var Combinatorics = require('js-combinatorics');
var outfile = path.resolve(__dirname, '.output/setup.out');
lab.experiment('setup: params', function () {
lab.before(function (done) {
fs.mkdirpSync(path.resolve(__dirname, '.output'));
done();
});
lab.after(function (done) {
fs.unlink(outfile);
done();
});
var params = {
host: 'http://localhost/',
branch: 'my-branch',
commit: 'sha',
project: 1,
apiKey: 'key',
name: 'stuff'
};
var keys = Object.keys(params);
var permutations = Combinatorics.permutation(keys).toArray();
permutations.forEach(function (permutation, index) {
var string = '';
permutation.forEach(function (param, index) {
if (index === permutation.length - 1) {
return; // only use 3
}
string += '--' + param + ' ' + params[param] + ' ';
});
lab.test('fails when missing required params combo ' + index, function (done) {
child.exec('node ' + __dirname + '/../lib/index.js --coverage 98.8 ' + string + ' > ' + outfile, function (err) {
code.expect(err).to.exist();
code.expect(err.toString()).to.contain('Missing one or many of required params (commit, branch, project, host, apiKey, name)');
done();
});
});
});
});