# config-nock

> Config based mocking using node-nock

Latest version **1.0.2** (published 2018-01-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install config-nock
pnpm add config-nock
yarn add config-nock
bun add config-nock
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-01-31 |
| First published | 2018-01-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Frank Desmettre |
| Maintainers | frankdsm |

## Links

- npm: https://www.npmjs.com/package/config-nock
- Repository: https://github.com/frankdsm/node-config-nock
- Homepage: https://github.com/frankdsm/node-config-nock#readme
- Issues: https://github.com/frankdsm/node-config-nock/issues
- npm.io page: https://npm.io/package/config-nock

## Dependencies (2)

- [nock](https://npm.io/package/nock.md) ~9.1.6
- [path-params](https://npm.io/package/path-params.md) ~0.1.0

## Recent versions

- 1.0.2 (latest) — 2018-01-31
- 1.0.1 — 2018-01-23
- 1.0.0 — 2018-01-23

## README

# config-nock
Config based mocking using node-nock

## Installation

```
npm install config-nock
```

## Usage
```
const request = require('request');
const mocker = require('config-nock');
const config = {
  'payment.monitoring': {
    baseUrl: 'https://example.com/api/',
    path: '/status/monitoring',
    method: 'GET',
    status: 200,
    options: {},
    response: ''
  }
};
mocker.setConfig(config);

// Enable mock
mocker.mock('payment.monitoring');

// Make a request in your tests
request.get('https://example.com/api/status/monitoring', (err, response, body) => {
  // Mocked request
});
```

## Run Tests
```
npm test
```

---
_Source: https://npm.io/package/config-nock · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
