
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
gulp-test-tools
Advanced tools
Testing tools for gulp
(example.js)
var runner = require('gulp-test-tools').gulpRunner;
runner({ verbose: true })
.basedir(__dirname)
.chdir('test')
.gulp('build', '--gulpfile fixtures/gulpfile.js')
.run(cb);
function cb(err, stdout, stderr) {
...
}
$ node example.js
---- command
cd /home/sttk/project;
cd test;
node /usr/local/lib/node_modules/gulp-cli/bin/gulp.js build --gulpfile fixtures/gulpfile.js
---- error
null
---- stdout
[20:11:53] Working directory changed to ~/project/test/fixtures
[22:11:53] Using gulpfile ~/project/test/fixtures/gulpfile.js
[20:11:53] Starting 'build'...
[20:11:53] Finished 'build' after 5.11 ms
---- stderr
----.
(example.js)
var eraseTime = require('gulp-test-tools').eraseTime;
var gulpOutput =
"[20:11:53] Starting 'default'...\n" +
"[20:11:53] Finished 'default' after 5.11 ms\n";
console.log(eraseTime(gulpOutput));
$ node example.js
Starting 'default'...
Finished 'default' after 5.11 ms
(example.js)
var eraseLapse = require('gulp-test-tools').eraseLapse;
var gulpOutput =
"[20:11:53] Starting 'default'...\n" +
"[20:11:53] Finished 'default' after 5.11 ms\n";
console.log(eraseLapse(gulpOutput));
$ node example.js
[20:11:53] Starting 'default'...
[20:11:53] Finished 'default' after ?
(example.js)
var skipLines = require('gulp-test-tools').skipLines;
var gulpOutput =
"[20:11:53] Using gulpfile ~/project/gulpfile-2.js\n" +
"[20:11:53] Starting 'default'...\n" +
"[20:11:53] Finished 'default' after 5.11 ms\n";
console.log(skipLines(gulpOutput, 1));
$ node example.js
[20:11:53] Starting 'default'...
[20:11:53] Finished 'default' after 5.11 ms
(example.js)
var headLines = require('gulp-test-tools').headLines;
var gulpOutput =
"[20:11:53] Using gulpfile ~/project/gulpfile-2.js\n" +
"[20:11:53] Starting 'default'...\n" +
"Hello, world!\n" +
"[20:11:53] Finished 'default' after 5.11 ms\n";
console.log(headLines(gulpOutput, 1, 2));
$ node example.js
Hello, world!
Though gulpRunner executes a command on a child process, it can get coverage about the command with istanbul. The way to get coverage is as follows:
$ istanbul cover example.js
If there are multiple test scripts, you can get their total coverage by following way:
$ istanbul cover example.js example2.js --print none && istanbul report lcov text-summary
If you run test scripts in the directory ./test
with istanbul + mocha, you should execute the following command:
$ istanbul cover _mocha --print none && istanbul report lcov text-summary
Creates a gulp runner which generates a command string and runs it.
opts [object] : options for a runner. This object has following properties:
true
, prints command, err, stdout, stderrbasedir(path)
Sets base directory path. This base directory is remained after running gulp.
Arguments:
chdir(path [, path ...])
Sets directory paths to be changed.
Arguments:
gulp(arg [, arg ...])
Sets gulp command with its arguments.
Arguments:
run(cb)
Runs gulp command.
Arguments:
Returns a text which is erased timestamp of each line.
Returns a text which is erased lapse time of ease line.
Returns a text which is skipped the specified number of lines.
Returns a first nLine
lines of a text. If second argument nSkip
is specified, first nSkip
lines are skipped.
MIT
FAQs
Test tools for gulp
The npm package gulp-test-tools receives a total of 1 weekly downloads. As such, gulp-test-tools popularity was classified as not popular.
We found that gulp-test-tools 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.