# request-moq

> Mock object for use instead http request in unit tests.

Latest version **1.0.1** (published 2016-09-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install request-moq
pnpm add request-moq
yarn add request-moq
bun add request-moq
```

## 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.1 |
| Published | 2016-09-17 |
| First published | 2016-09-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sergey Egorov |
| Maintainers | egorov |
| Keywords | request, mock |

## Links

- npm: https://www.npmjs.com/package/request-moq
- Repository: https://github.com/egorov/request-moq
- Homepage: https://github.com/egorov/request-moq#readme
- Issues: https://github.com/egorov/request-moq/issues
- npm.io page: https://npm.io/package/request-moq

## Dependencies (1)

- [fixed-size-queue](https://npm.io/package/fixed-size-queue.md) *

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [@crvouga/mockingbird-service-vercel](https://npm.io/package/@crvouga/mockingbird-service-vercel.md) — 0 weekly downloads
- [@crvouga/mockingbird-service-tempo](https://npm.io/package/@crvouga/mockingbird-service-tempo.md) — 0 weekly downloads
- [@crvouga/mockingbird-service-okta](https://npm.io/package/@crvouga/mockingbird-service-okta.md) — 0 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-09-17
- 1.0.0 — 2016-09-17

## README

# request-moq ![Build status](https://travis-ci.org/egorov/request-moq.svg?branch=master)

Mock object for use instead http [request](https://github.com/request/request) in unit tests.

You can add it to your project with npm:

    npm install --save-dev request-moq

Quickstart guide:

    var mRequest = require('request-moq');
    
    var options = {
        method: 'GET',
        url: 'http://localhost',
        headers: [ { Accept: 'application-json'} ]
        };
        
    mRequest.expect(options).respond({statusCode: 201});
    
    mRequest(options, function(error, response, body){
    
            expect(error).toBeUndefined();
            expect(response.statusCode).toEqual(201);
            expect(body).toBeUndefined();
            
        });
        
Other usage examples you can find at spec/RequestMoqSpec.js.

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