import Exchange from './Exchange'; import Queue from './Queue'; import Rpc from './rpc'; /** * Creates a mock wrapper for the wabbitzzz library for testing purposes. * This function stubs the main wabbitzzz methods and provides utilities to access and control the mocked instances. * * @param {object} wabbitzzz - The wabbitzzz library instance to be mocked * @returns {object} Mock wrapper object with stubbed methods and utilities * * @example * ```typescript * import wabbitzzz from 'wabbitzzz'; * import wabbitzzzMock from 'wabbitzzz-mock'; * * const mock = wabbitzzzMock(wabbitzzz); * // Use mock.queue(), mock.exchange(), mock.rpc() to access mocked instances * // Use mock.restore() to clean up after tests * ``` */ declare const _default: (wabbitzzz: any) => { /** @type {sinon.SinonStub} Stubbed Exchange constructor */ Exchange: any; /** @type {sinon.SinonStub} Stubbed Queue constructor */ Queue: any; /** @type {sinon.SinonStub} Stubbed rpc method */ rpc: any; /** @type {sinon.SinonStub} Stubbed response method */ response: any; /** Mock utilities object */ mock: { /** * Retrieves a mocked queue instance by name * @param {string} queueName - The name of the queue to retrieve * @returns {Queue|undefined} The mocked queue instance or undefined if not found */ queue: (queueName: any) => Queue; /** * Retrieves a mocked exchange instance by name * @param {string} exchangeName - The name of the exchange to retrieve * @returns {Exchange|undefined} The mocked exchange instance or undefined if not found */ exchange: (exchangeName: any) => Exchange; /** * Retrieves or creates a mocked RPC instance by name * @param {string} rpcName - The name of the RPC method * @returns {Rpc} The mocked RPC instance */ rpc: (rpcName: any) => Rpc; /** * Restores all stubs and cleans up mocked instances. * This should be called after each test to prevent test interference. * @returns {Promise} Promise that resolves when cleanup is complete */ restore: () => Promise; }; mocked: { /** * Retrieves a mocked queue instance by name * @param {string} queueName - The name of the queue to retrieve * @returns {Queue|undefined} The mocked queue instance or undefined if not found */ queue: (queueName: any) => Queue; /** * Retrieves a mocked exchange instance by name * @param {string} exchangeName - The name of the exchange to retrieve * @returns {Exchange|undefined} The mocked exchange instance or undefined if not found */ exchange: (exchangeName: any) => Exchange; /** * Retrieves or creates a mocked RPC instance by name * @param {string} rpcName - The name of the RPC method * @returns {Rpc} The mocked RPC instance */ rpc: (rpcName: any) => Rpc; /** * Restores all stubs and cleans up mocked instances. * This should be called after each test to prevent test interference. * @returns {Promise} Promise that resolves when cleanup is complete */ restore: () => Promise; }; }; export default _default;