Skip to content

Commit

Permalink
test(FanOutExchangeManager): test binding queues of different types
Browse files Browse the repository at this point in the history
Test binding queues of different types to the same fanout exchange.
  • Loading branch information
weyoss committed Oct 25, 2022
1 parent 0df6bdc commit d2e287c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/tests/exchanges/fanout-exchange/test00008.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { FanOutExchange } from '../../../../src/lib/exchange/fan-out-exchange';
import { getFanOutExchangeManager } from '../../../common/fanout-exchange-manager';
import { getQueueManager } from '../../../common/queue-manager';
import { FanOutExchangeQueueError } from '../../../../src/lib/exchange/errors/fan-out-exchange-queue.error';

test('FanOutExchange: binding different types of queues', async () => {
const fanOutExchangeManager = await getFanOutExchangeManager();

const e1 = new FanOutExchange('e1');
await fanOutExchangeManager.createExchangeAsync(e1);

const q1 = { ns: 'testing', name: 'w123' };
const { queue } = await getQueueManager();
await queue.createAsync(q1, false);
await fanOutExchangeManager.bindQueueAsync(q1, e1);

const q2 = { ns: 'testing', name: 'w456' };
await queue.createAsync(q2, true);

await expect(fanOutExchangeManager.bindQueueAsync(q2, e1)).rejects.toThrow(
FanOutExchangeQueueError,
);
});

0 comments on commit d2e287c

Please sign in to comment.