Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
cli-tester
Advanced tools
Readme
Lean promisified wrapper to test NodeJS CLI scripts
Plays nicely with blue-tape
npm install --save-dev cli-tester
const test = require('blue-tape');
const tester = require('cli-tester');
test('Successful run', t =>
tester(require.resolve('./cli-that-is-ok'))
.then(({code, stdout, stderr}) => {
t.equal(code, 0, 'should exit with code 0');
t.equal(stdout, 'check expected output');
t.equal(stderr, '', 'should not have any errors');
}));
test('CLI throws', t =>
tester(require.resolve('./cli-that-throws'))
.then(({code, stdout, stderr}) => {
t.equal(code, 1, 'should exit with code 1');
t.equal(stdout, '', 'should not have any output');
t.ok(stderr.match('some error from CLI'));
}));
const tester = require('cli-tester/es5');
tester(cli, env, ...args)
Returns ES6 Promise, that is always successful
Resolved path to JS CLI, ideally absolute path
tester(require.resolve('./cli'))
Object with ENV vars
tester(require.resolve('./cli'), {OMG: 'OMG!'})
List of command line arguments
// With omitted ENV
tester(require.resolve('./cli'), '--hello', 'world')
// With ENV
tester(require.resolve('./cli'), {OMG: 'OMG!'},'--hello', 'world')
Currently is being developed and tested with the latest stable Node 7
under OSX
and Windows
.
git clone git@github.com:nkbt/cli-tester.git
cd cli-tester
npm install
# to run tests
npm test
# to generate test coverage (./coverage)
npm run cov
MIT
FAQs
Lean promisified wrapper to test NodeJS CLI scripts
The npm package cli-tester receives a total of 10 weekly downloads. As such, cli-tester popularity was classified as not popular.
We found that cli-tester demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.