Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
docker-mock
Advanced tools
A mock for Docker!
Require it from your node program:
var dockerMock = require('docker-mock');
dockerMock.listen(5354);
You can also use the command line interface, just run docker-mock
after installing the package globally.
See the tests for some sample usage, but you should be able to point your docker client at this mock and test against it.
This does have support for simulating failures during build. This is done (using dockerode
) by doing the following:
// file is a tar containing at minimum a Dockerfile
var file = ...;
docker.buildImage(
file,
{
t: 'doomedImage',
fail: true
},
function (err, res) {
// err will not be null
});
If you want to disable randomly generated events exposed under /events
endpoint please use ENV var: DISABLE_RANDOM_EVENTS=true
.
You can manually emit docker mock events.
var dockerMock = require('docker-mock');
dockerMock.listen(5354);
dockerMock.events.stream.emit('data', JSON.stringify({ status: 'die', from: '..', id: '...', time: '...' }));
// or
dockerMock.events.stream.emit('data', dockerMock.events.generateEvent());
Please make sure all unit tests pass, lint passes, and coverage remains high during development (see below for details).
Testing is done locally via npm test
.
Coverage is now run by Lab via npm test
. Output at the bottom shows percent coverage verses a threshold set in package.json
.
v5.0.1 (2015/10/09 01:28 +00:00)
FAQs
Mock for Docker
The npm package docker-mock receives a total of 17 weekly downloads. As such, docker-mock popularity was classified as not popular.
We found that docker-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.