Skip to content

ExpressenAB/exp-fake-amqplib

Repository files navigation

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);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published