Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Zuul is a test runner/harness to make running your mocha tests in a browser easier. Just point it at your mocha test files and let zuul consume them!
If you want to see the output of your mocha tests in a pretty browser window use zuul with the server
option.
$ zuul --server 9000 /path/to/your/tests
Zuul will start a server on localhost:9000 which you can visit to get awesome html output (courtesy of mocha).
If you just want to run your tests in a headless environment courtesy of mocha-phantomjs and phantomjs, zuul will oblige!
$ zuul /path/to/your/tests
You can specify either a specific javascript file(s) or a directory(s) to zuul. If you specify a directory, zuul will load all of the .js
files in that directory.
If test/mocha.opts
is available relative to your launch directory, then zuul will incorporate those options into the mocha setup.
$ npm install -g zuul
zuul [options] file(s)|dir
Options:
--server port to start harness server for manual testing
--wwwroot location where the webserver will serve additional static files
--ui mocha ui (bdd, tdd, qunit, exports
--config point to a config file that overrides zuul settings
Most likely zuul will serve your needs out of the box, but if you need to customize the browserify
step, the
test fixture and/or want to add extra endpoints to the zuul test server, the --config
option is your friend.
Lets say we have a ./zuul-config.js
file in our current directory, running zuul --config ./zuul-config.js
picks up
eventual overrides specified in it, all of which are optional:
{Object}
options passed to browserify().bundle(options)
{Function}
returning a {String}
that allows overriding the default html
fixture, but needs to keep the necessary setup
(mocha, phantom) in order to work with zuul{Function}
invoked with the app
instance and express
which allows adding endpoints to the app and
whatever else you need to do to properly set up your tests{Function}
invoked with browserify
that needs to return a browserify instance that can be initialized according to our needsHere is an example zuul-config.js
:
var fs = require('fs');
var path = require('path');
// overriding the browserify instance creation in order to add a transform
exports.initBrowserify = function (browserify) {
return browserify().transform('brfs');
};
// at times we need to override browserify bundle options
exports.bundleOpts = { ignoreMissing: true, debug: true };
// we need to add a sinon.js script tag, so we'll use our custom fixture
exports.fixture = function () {
return fs.readFileSync(path.join(testroot, 'fixture.html'), 'utf8');
};
exports.initApp = function (app, express) {
var sinonpkg = path.join(path.dirname(require.resolve('sinon')), '..', 'pkg', 'sinon.js');
// log requests made to the zuul test server
app.use(express.logger('dev'));
// provide the sinon file that we request via a script tag in our custom fixture
app.get('/sinon.js', function (req, res) {
res.sendfile(sinonpkg);
});
};
If you want to use this programmatically, do var zuul = require('zuul')
and call it with some of these options.
{Array}
of test filenames or directory names. Defaults to ['test']
, which will pick up all .js
files under the test
directory under the CWD.{Object|String}
Either an object containing the Mocha options, or a string path to a mocha.opts
file. Defaults to test/mocha.opts
under the CWD.{Number}
giving the port to run a server on for manual testing. Leaving this out will run the tests in PhantomJS.{String}
allowing you to easily specify or override the Mocha UI used (bdd, tdd, qunit, or exports). Takes precedence over mochaOpts
.{String}
giving a directory to serve static content from.This probject is just a tiny tool. The real credit goes to these projects.
FAQs
simple browser testing
The npm package zuul receives a total of 3,246 weekly downloads. As such, zuul popularity was classified as popular.
We found that zuul demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.