Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(async () => {
const module = await Test.createTestingModule({
controllers: [RMQBroadcastController],
}).compile();
server = express();
app = module.createNestApplication(server);
app.connectMicroservice({
transport: Transport.RMQ,
options: {
urls: [`amqp://admin:admin@localhost`],
queue: 'test',
queueOptions: { durable: false },
},
});
app.connectMicroservice({
transport: Transport.RMQ,
options: {
urls: [`amqp://admin:admin@localhost`],
queue: 'test',
queueOptions: { durable: false },
},
});
await app.startAllMicroservicesAsync();
await app.init();
beforeEach(async () => {
const module = await Test.createTestingModule({
controllers: [RMQController],
}).compile();
server = express();
app = module.createNestApplication(server);
app.connectMicroservice({
transport: Transport.RMQ,
options: {
urls: [`amqp://localhost:5672`],
queue: 'test',
queueOptions: { durable: false },
},
});
await app.startAllMicroservicesAsync();
await app.init();
});
const module = await Test.createTestingModule({
controllers: [RMQBroadcastController],
}).compile();
server = express();
app = module.createNestApplication(server);
app.connectMicroservice({
transport: Transport.RMQ,
options: {
urls: [`amqp://admin:admin@localhost`],
queue: 'test',
queueOptions: { durable: false },
},
});
app.connectMicroservice({
transport: Transport.RMQ,
options: {
urls: [`amqp://admin:admin@localhost`],
queue: 'test',
queueOptions: { durable: false },
},
});
await app.startAllMicroservicesAsync();
await app.init();
});
constructor() {
this.client = ClientProxyFactory.create({
transport: Transport.RMQ,
options: {
urls: [`amqp://localhost:5672`],
queue: 'test',
queueOptions: { durable: false },
socketOptions: { noDelay: true },
},
});
}
constructor() {
this.client = ClientProxyFactory.create({
transport: Transport.RMQ,
options: {
urls: [`amqp://localhost:5672`],
queue: 'test_broadcast',
queueOptions: { durable: false },
socketOptions: { noDelay: true },
},
});
}