@@ -256,6 +256,39 @@ describe('ServerKafka', () => {
256256 expect ( run . called ) . to . be . true ;
257257 expect ( connect . called ) . to . be . true ;
258258 } ) ;
259+ it ( 'should pass run options with partitionsConsumedConcurrently to consumer.run()' , async ( ) => {
260+ untypedServer . logger = new NoopLogger ( ) ;
261+ untypedServer . options . run = {
262+ partitionsConsumedConcurrently : 5 ,
263+ } ;
264+ await server . listen ( callback ) ;
265+ await server . bindEvents ( untypedServer . consumer ) ;
266+
267+ expect ( run . called ) . to . be . true ;
268+ expect ( run . firstCall . args [ 0 ] ) . to . include ( {
269+ partitionsConsumedConcurrently : 5 ,
270+ } ) ;
271+ expect ( run . firstCall . args [ 0 ] ) . to . have . property ( 'eachMessage' ) ;
272+ } ) ;
273+ it ( 'should pass multiple run options to consumer.run()' , async ( ) => {
274+ untypedServer . logger = new NoopLogger ( ) ;
275+ untypedServer . options . run = {
276+ partitionsConsumedConcurrently : 3 ,
277+ autoCommit : false ,
278+ autoCommitInterval : 5000 ,
279+ } ;
280+ await server . listen ( callback ) ;
281+ await server . bindEvents ( untypedServer . consumer ) ;
282+
283+ expect ( run . called ) . to . be . true ;
284+ const callArg = run . firstCall . args [ 0 ] ;
285+ expect ( callArg ) . to . include ( {
286+ partitionsConsumedConcurrently : 3 ,
287+ autoCommit : false ,
288+ autoCommitInterval : 5000 ,
289+ } ) ;
290+ expect ( callArg ) . to . have . property ( 'eachMessage' ) ;
291+ } ) ;
259292 } ) ;
260293
261294 describe ( 'getMessageHandler' , ( ) => {
0 commit comments