Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
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
.
FAQs
Mock for Docker
The npm package docker-mock receives a total of 58 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.