Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ServiceBroker = require("../../../src/service-broker");
const Transit = require("../../../src/transit");
const RedisTransporter = require("../../../src/transporters/redis");
const P = require("../../../src/packets");
jest.mock("ioredis");
let Redis = require("ioredis");
Redis.mockImplementation(() => {
let onCallbacks = {};
return {
on: jest.fn((event, cb) => onCallbacks[event] = cb),
disconnect: jest.fn(),
subscribe: jest.fn(),
publish: jest.fn(),
onCallbacks
};
});
describe("Test RedisTransporter constructor", () => {
it("check constructor", () => {
let transporter = new RedisTransporter();