mock-amqplib

1.8.2 • Public • Published

mock-amqplib

This module is intended to replace rabbitMq in integration tests to gain speed in test execution.

Usage

with mock-require in tests:

// setup
var mockRequire = require('mock-require');
mockRequire('amqplib', 'mock-amqplib');

// teardow
mockRequire.stopAll();

or simply overwrite amqplibs connect method:

amqplib.connect = mockAmqplib.connect;

Similar modules:

amqplib-mocks, exp-fake-amqplib (callbacks only), amqplib-mock,

As far as I can tell they try to solve the same problem, but they implemented different parts of the API.

For this module I implemented whatever was neccesary to use it in the app I'm currently developing, so parts are missing here too, pull requests are welcome.

/mock-amqplib/

    Package Sidebar

    Install

    npm i mock-amqplib

    Weekly Downloads

    4,385

    Version

    1.8.2

    License

    ISC

    Unpacked Size

    38.9 kB

    Total Files

    4

    Last publish

    Collaborators

    • mkls