exp-fake-amqplib
v3.0.3
Published
Stubbing amqplib
Downloads
99
Readme
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:
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);