exp-fake-amqplib

3.0.3 • Public • Published

exp-fake-amqplib

Build Statusdependencies Status

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:

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 you can use mock-require to replace amqplib with exp-fake-amqplib in your tests like this:

const mock = require("mock-require");
const fakeAmqp = require("exp-fake-amqplib");
 
mock("amqplib/callback_api", fakeAmqp);

/exp-fake-amqplib/

    Package Sidebar

    Install

    npm i exp-fake-amqplib

    Weekly Downloads

    17

    Version

    3.0.3

    License

    MIT

    Unpacked Size

    5.86 kB

    Total Files

    4

    Last publish

    Collaborators

    • theneubeck
    • paed01
    • norla