Mock for Docker
A mock for Docker!
Require it from your node program:
var dockerMock = ;dockerMock;
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 Dockerfilevar file = ...;docker;
If you want to disable randomly generated events exposed under
/events endpoint please use ENV var:
You can manually emit docker mock events.
var dockerMock = ;dockerMock;dockerMockeventsstream;// ordockerMockeventsstream;
Please make sure all unit tests pass, lint passes, and coverage remains high during development (see below for details).
Testing is done locally via
Coverage is now run by Lab via
npm test. Output at the bottom shows percent coverage verses a threshold set in