How to use the @golevelup/nestjs-rabbitmq.RabbitMQModule.forRoot function in @golevelup/nestjs-rabbitmq

To help you get started, we’ve selected a few @golevelup/nestjs-rabbitmq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github golevelup / nestjs / integration / rabbitmq / e2e / subscribe.e2e-spec.ts View on Github external
beforeEach(async () => {
    const moduleFixture = await Test.createTestingModule({
      providers: [SubscribeService],
      imports: [
        RabbitMQModule.forRoot(RabbitMQModule, {
          exchanges: [
            {
              name: exchange,
              type: 'topic',
            },
          ],
          uri,
        }),
      ],
    }).compile();

    app = moduleFixture.createNestApplication();
    amqpConnection = app.get(AmqpConnection);
    await app.init();
  });
github golevelup / nestjs / integration / rabbitmq / e2e / configuration.e2e-spec.ts View on Github external
it('should configure RabbitMQ', async () => {
      const spy = jest.spyOn(amqplib, 'connect');

      app = await Test.createTestingModule({
        imports: [
          RabbitMQModule.forRoot(RabbitMQModule, {
            uri,
          }),
        ],
      }).compile();

      expect(spy).toHaveBeenCalledTimes(1);
      expect(spy).toHaveBeenCalledWith(uri);
    });
  });