File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,36 @@ let doTest = (tls) => {
316
316
} , 100 ) ;
317
317
} ) ;
318
318
319
+ it ( 'should send messages with different tags correctly in PackedForward' , ( done ) => {
320
+ runServer ( { } , serverOptions , ( server , finish ) => {
321
+ const s1 = new FluentSender ( 'debug' , Object . assign ( { } , clientOptions , {
322
+ port : server . port ,
323
+ eventMode : 'PackedForward'
324
+ } ) ) ;
325
+ const emits = [ ] ;
326
+ function emit ( messageData ) {
327
+ emits . push ( ( asyncDone ) => {
328
+ s1 . emit ( `multi-${ messageData . number } ` , { text : messageData . text } ) ;
329
+ asyncDone ( ) ; // run immediately do not wait for ack
330
+ } ) ;
331
+ }
332
+ for ( let i = 0 ; i < 5 ; i ++ ) {
333
+ emit ( { number : i , text : `This is text No ${ i } ` } ) ;
334
+ }
335
+ emits . push ( ( ) => {
336
+ finish ( ( data ) => {
337
+ expect ( data . length ) . to . be . equal ( 5 ) ;
338
+ data . forEach ( ( element , index ) => {
339
+ expect ( element . tag ) . to . be . equal ( `debug.multi-${ index } ` ) ;
340
+ expect ( element . data . text ) . to . be . equal ( `This is text No ${ index } ` ) ;
341
+ } ) ;
342
+ done ( ) ;
343
+ } ) ;
344
+ } ) ;
345
+ async . series ( emits ) ;
346
+ } ) ;
347
+ } ) ;
348
+
319
349
[
320
350
{
321
351
name : 'tag and record' ,
You can’t perform that action at this time.
0 commit comments