1- import * as express from 'express' ;
2- import * as request from 'supertest' ;
3- import { Test } from '@nestjs/testing' ;
41import { INestApplication } from '@nestjs/common' ;
52import { Transport } from '@nestjs/microservices' ;
3+ import { Test } from '@nestjs/testing' ;
4+ import * as express from 'express' ;
5+ import * as request from 'supertest' ;
66import { RMQController } from '../src/rmq/rmq.controller' ;
77
88describe ( 'RabbimMQ transport' , ( ) => {
@@ -17,16 +17,16 @@ describe('RabbimMQ transport', () => {
1717 server = express ( ) ;
1818 app = module . createNestApplication ( server ) ;
1919 app . connectMicroservice ( {
20- transport : Transport . RMQ ,
21- options : {
22- urls : [ `amqp://admin:admin@ localhost` ] ,
23- queue : 'test' ,
24- queueOptions : { durable : false } ,
25- } ,
20+ transport : Transport . RMQ ,
21+ options : {
22+ urls : [ `amqp://localhost:5672 ` ] ,
23+ queue : 'test' ,
24+ queueOptions : { durable : false } ,
25+ } ,
2626 } ) ;
2727 await app . startAllMicroservicesAsync ( ) ;
2828 await app . init ( ) ;
29- } ) ;
29+ } ) ;
3030
3131 it ( `/POST` , ( ) => {
3232 return request ( server )
@@ -54,11 +54,16 @@ describe('RabbimMQ transport', () => {
5454 return request ( server )
5555 . post ( '/concurrent' )
5656 . send ( [
57- [ 1 , 2 , 3 , 4 , 5 ] ,
58- [ 6 , 7 , 8 , 9 , 10 ] ,
59- [ 11 , 12 , 13 , 14 , 15 ] ,
60- [ 16 , 17 , 18 , 19 , 20 ] ,
61- [ 21 , 22 , 23 , 24 , 25 ] ,
57+ Array . from ( { length : 10 } , ( v , k ) => k + 1 ) ,
58+ Array . from ( { length : 10 } , ( v , k ) => k + 11 ) ,
59+ Array . from ( { length : 10 } , ( v , k ) => k + 21 ) ,
60+ Array . from ( { length : 10 } , ( v , k ) => k + 31 ) ,
61+ Array . from ( { length : 10 } , ( v , k ) => k + 41 ) ,
62+ Array . from ( { length : 10 } , ( v , k ) => k + 51 ) ,
63+ Array . from ( { length : 10 } , ( v , k ) => k + 61 ) ,
64+ Array . from ( { length : 10 } , ( v , k ) => k + 71 ) ,
65+ Array . from ( { length : 10 } , ( v , k ) => k + 81 ) ,
66+ Array . from ( { length : 10 } , ( v , k ) => k + 91 ) ,
6267 ] )
6368 . expect ( 200 , 'true' ) ;
6469 } ) ;
0 commit comments