# exp-fake-amqplib

> Stubbing amqplib

Latest version **3.0.3** (published 2019-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install exp-fake-amqplib
pnpm add exp-fake-amqplib
yarn add exp-fake-amqplib
bun add exp-fake-amqplib
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2019-12-02 |
| First published | 2016-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.9.0 |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | AB Kvällstidningen Expressen |
| Maintainers | norla, paed01 |
| Keywords | amqplib, amqp, node, mock, test |

## Links

- npm: https://www.npmjs.com/package/exp-fake-amqplib
- Repository: https://github.com/ExpressenAB/exp-fake-amqplib
- Homepage: https://github.com/ExpressenAB/exp-fake-amqplib#readme
- Issues: https://github.com/ExpressenAB/exp-fake-amqplib/issues
- npm.io page: https://npm.io/package/exp-fake-amqplib

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 3.0.3 (latest) — 2019-12-02
- 3.0.2 — 2019-10-17
- 3.0.0 — 2018-04-26
- 2.0.1 — 2017-01-25
- 2.0.0 — 2016-11-30
- 1.0.3 — 2016-05-10
- 1.0.2 — 2016-04-28
- 1.0.1 — 2016-04-19
- 1.0.0 — 2016-04-15

## README

## exp-fake-amqplib

[![Build Status](https://travis-ci.org/ExpressenAB/exp-fake-amqplib.svg?branch=master)](https://travis-ci.org/ExpressenAB/exp-fake-amqplib)[![dependencies Status](https://david-dm.org/ExpressenAB/exp-fake-amqplib/status.svg)](https://david-dm.org/ExpressenAB/exp-fake-amqplib)

Mocked version of https://www.npmjs.com/package/amqplib.
Currently only supports the callback API.

### Overriding amqplib

You might want to override `amqplib` with `exp-fake-amqplib` in tests. This can be done this way:

```javascript
const amqplib = require("amqplib");
const fakeAmqplib = require("exp-fake-amqplib");

amqplib.connect = fakeAmqp.connect;
```

If you are using version 2 or higher of [exp-amqp-connection](https://www.npmjs.com/package/exp-amqp-connection)
you can use [mock-require](https://www.npmjs.com/package/mock-require) to replace `amqplib` with `exp-fake-amqplib` in your tests like this:

```javascript
const mock = require("mock-require");
const fakeAmqp = require("exp-fake-amqplib");

mock("amqplib/callback_api", fakeAmqp);
```

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