@@ -45,7 +45,7 @@ test('can publish and consume', () => {
4545 . then ( conn => conn . channel ( ) )
4646 . then ( ch => ch . queue ( "" ) )
4747 . then ( q => q . publish ( "hello world" ) )
48- . then ( q => q . subscribe ( { noAck : false } , msg => {
48+ . then ( q => q . subscribe ( { noAck : false } , msg => {
4949 msg . ack ( )
5050 resolve ( msg )
5151 } ) )
@@ -60,7 +60,7 @@ test('can nack a message', () => {
6060 . then ( conn => conn . channel ( ) )
6161 . then ( ch => ch . queue ( "" ) )
6262 . then ( q => q . publish ( "hello world" ) )
63- . then ( q => q . subscribe ( { noAck : false } , msg => {
63+ . then ( q => q . subscribe ( { noAck : false } , msg => {
6464 msg . nack ( )
6565 resolve ( msg )
6666 } ) )
@@ -75,7 +75,7 @@ test('can reject a message', () => {
7575 . then ( conn => conn . channel ( ) )
7676 . then ( ch => ch . queue ( "" ) )
7777 . then ( q => q . publish ( "hello world" ) )
78- . then ( q => q . subscribe ( { noAck : false } , msg => {
78+ . then ( q => q . subscribe ( { noAck : false } , msg => {
7979 msg . reject ( )
8080 resolve ( msg )
8181 } ) )
@@ -115,7 +115,7 @@ test("can get message from a queue", async () => {
115115 const ch = await conn . channel ( )
116116 const q = await ch . queue ( "" )
117117 await q . publish ( "message" )
118- const msg = await q . get ( { noAck : true } )
118+ const msg = await q . get ( { noAck : true } )
119119 expect ( ( msg as AMQPMessage ) . bodyString ( ) ) . toEqual ( "message" )
120120} )
121121
@@ -131,7 +131,7 @@ test('will throw an error after consumer timeout', async () => {
131131 const conn = await amqp . connect ( )
132132 const ch = await conn . channel ( )
133133 const q = await ch . queue ( "" )
134- const consumer = await q . subscribe ( { noAck : false } , ( ) => "" )
134+ const consumer = await q . subscribe ( { noAck : false } , ( ) => "" )
135135 await expect ( consumer . wait ( 1 ) ) . rejects . toThrow ( )
136136} )
137137
@@ -140,7 +140,7 @@ test('will throw an error if consumer is closed', async () => {
140140 const conn = await amqp . connect ( )
141141 const ch = await conn . channel ( )
142142 const q = await ch . queue ( "" )
143- const consumer = await q . subscribe ( { noAck : false } , ( ) => "" )
143+ const consumer = await q . subscribe ( { noAck : false } , ( ) => "" )
144144 consumer . setClosed ( new Error ( "testing" ) )
145145 try {
146146 await consumer . wait ( 1 ) ;
@@ -154,7 +154,7 @@ test('can cancel a consumer', () => {
154154 return amqp . connect ( )
155155 . then ( ( conn ) => conn . channel ( ) )
156156 . then ( ( ch ) => ch . queue ( "" ) )
157- . then ( ( q ) => q . subscribe ( { noAck : false } , console . log ) )
157+ . then ( ( q ) => q . subscribe ( { noAck : false } , console . log ) )
158158 . then ( ( consumer ) => consumer . cancel ( ) )
159159 . then ( ( channel ) => expect ( channel . consumers . size ) . toEqual ( 0 ) )
160160} )
@@ -164,7 +164,7 @@ test('will clear consumer wait timeout on cancel', async () => {
164164 const conn = await amqp . connect ( )
165165 const ch = await conn . channel ( )
166166 const q = await ch . queue ( "" )
167- const consumer = await q . subscribe ( { noAck : false } , ( ) => "" )
167+ const consumer = await q . subscribe ( { noAck : false } , ( ) => "" )
168168 const wait = consumer . wait ( 5000 ) ;
169169 consumer . cancel ( )
170170 await expect ( wait ) . resolves . toBeUndefined ( )
@@ -241,7 +241,7 @@ test('wait for publish confirms', async () => {
241241 ch . basicPublish ( "amq.fanout" , "rk" , "body" ) ,
242242 ch . basicPublish ( "amq.fanout" , "rk" , "body" )
243243 ] )
244- expect ( tags ) . toEqual ( [ 3 , 4 ] )
244+ expect ( tags ) . toEqual ( [ 3 , 4 ] )
245245} )
246246
247247test ( 'can handle returned messages' , async ( ) => {
@@ -261,7 +261,7 @@ test('can handle nacks on confirm channel', async () => {
261261 const conn = await amqp . connect ( )
262262 const ch = await conn . channel ( )
263263
264- const q = await ch . queue ( "" , { } , { "x-overflow" : "reject-publish" , "x-max-length" : 0 } )
264+ const q = await ch . queue ( "" , { } , { "x-overflow" : "reject-publish" , "x-max-length" : 0 } )
265265 await ch . confirmSelect ( )
266266 await expect ( q . publish ( "body" ) ) . rejects . toThrow ( "Message rejected" )
267267} )
@@ -391,7 +391,7 @@ test('can publish all type of properties', async () => {
391391 const q = await ch . queue ( )
392392 const headers = {
393393 a : 2 , b : true , c : "c" , d : 1.5 , e : null , f : new Date ( 1000 ) , g : { a : 1 } ,
394- i : 2 ** 32 + 1 , j : 2.5 ** 33 ,
394+ i : 2 ** 32 + 1 , j : 2.5 ** 33 ,
395395 }
396396 const properties = {
397397 contentType : "application/json" ,
@@ -406,7 +406,7 @@ test('can publish all type of properties', async () => {
406406 appId : "appid" ,
407407 userId : "guest" ,
408408 type : "type" ,
409- timestamp : new Date ( Math . round ( Date . now ( ) / 1000 ) * 1000 ) // amqp timestamps does only have second resolution
409+ timestamp : new Date ( Math . round ( Date . now ( ) / 1000 ) * 1000 ) // amqp timestamps does only have second resolution
410410 }
411411 await q . publish ( "" , properties )
412412 const msg = await q . get ( )
@@ -512,7 +512,7 @@ test("can do basicRecover", async () => {
512512} )
513513
514514test ( "can set frameMax" , async ( ) => {
515- const amqp = getNewClient ( { frameMax : 16 * 1024 } )
515+ const amqp = getNewClient ( { frameMax : 16 * 1024 } )
516516 const conn = await amqp . connect ( )
517517 const ch = await conn . channel ( )
518518 await ch . confirmSelect ( )
@@ -536,7 +536,7 @@ test("can't set too small frameMax", () => {
536536} )
537537
538538test ( "can handle frames split over socket reads" , async ( ) => {
539- const amqp = getNewClient ( { frameMax : 4 * 1024 } )
539+ const amqp = getNewClient ( { frameMax : 4 * 1024 } )
540540 const conn = await amqp . connect ( )
541541 const ch = await conn . channel ( )
542542 const q = await ch . queue ( "" )
@@ -610,8 +610,8 @@ test("will throw on too large headers", async () => {
610610 const amqp = getNewClient ( { frameMax : 4096 } )
611611 const conn = await amqp . connect ( )
612612 const ch = await conn . channel ( )
613- await expect ( ch . basicPublish ( "" , "x" . repeat ( 255 ) , null , { "headers" : { a : Array ( 4000 ) . fill ( 1 ) } } ) ) . rejects . toThrow ( RangeError )
614- await expect ( ch . basicPublish ( "" , "" , null , { "headers" : { a : "x" . repeat ( 5000 ) } } ) ) . rejects . toThrow ( RangeError )
613+ await expect ( ch . basicPublish ( "" , "x" . repeat ( 255 ) , null , { "headers" : { a : Array ( 4000 ) . fill ( 1 ) } } ) ) . rejects . toThrow ( RangeError )
614+ await expect ( ch . basicPublish ( "" , "" , null , { "headers" : { a : "x" . repeat ( 5000 ) } } ) ) . rejects . toThrow ( RangeError )
615615} )
616616
617617test ( "will split body over multiple frames" , async ( ) => {
@@ -628,7 +628,7 @@ test("will split body over multiple frames", async () => {
628628 else
629629 assert . fail ( "no body" )
630630 else
631- assert . fail ( "no msg" )
631+ assert . fail ( "no msg" )
632632} )
633633
634634test ( "can republish in consume block without race condition" , async ( ) => {
@@ -639,7 +639,7 @@ test("can republish in consume block without race condition", async () => {
639639 const q = await ch . queue ( "" )
640640 await ch . confirmSelect ( )
641641 await q . publish ( "x" . repeat ( 500 ) )
642- const consumer = await q . subscribe ( { noAck : false } , async ( msg ) => {
642+ const consumer = await q . subscribe ( { noAck : false } , async ( msg ) => {
643643 if ( msg . deliveryTag < 10000 ) {
644644 await Promise . all ( [
645645 q . publish ( msg . body ) ,
0 commit comments