New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dockerode-mock

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dockerode-mock

Mocking module for dockerode

latest
Source
npmnpm
Version
0.3.2
Version published
Maintainers
1
Created
Source

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' }
}

Keywords

mock

FAQs

Package last updated on 22 Apr 2017

Did you know?

Socket

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.

Install

Related posts