0.3.2 • Published 7 years ago

dockerode-mock v0.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Dockerode Mock

Mocking module for Dockerode.

Usage

First install the package.

npm install --save-dev dockerode-mock

Next use a mocking library to replace the dockerode module with dockerode-mock.

Finally specify the overrides you wish to use before and after each test.

import * as docker from 'dockerode-mock'

//Apply to all engines
docker.overrides = {
	'GET /_ping': { error: 'connection error' },
	'GET /containers/json?': { ... },
}

//Apply to specific engines
docker.overrides = {
	'GET 192.168.0.5/_ping': 'OK',
	'GET 192.168.0.5:4243/_ping': 'OK',
	'GET tcp://192.168.0.5:4243/_ping': { error: 'connection error' }
}
0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago