@@ -698,10 +698,32 @@ describe('Subscriber', () => {
698698 } ) ;
699699
700700 describe ( 'nack' , ( ) => {
701+ it ( 'should remove the message from the inventory' , async ( ) => {
702+ const inventory : FakeLeaseManager = stubs . get ( 'inventory' ) ;
703+ const stub = sandbox . stub ( inventory , 'remove' ) . withArgs ( message ) ;
704+
705+ await subscriber . nack ( message ) ;
706+
707+ assert . strictEqual ( stub . callCount , 1 ) ;
708+ } ) ;
709+ } ) ;
710+
711+ describe ( 'nackWithResponse' , ( ) => {
712+ it ( 'should remove the message from the inventory' , async ( ) => {
713+ const inventory : FakeLeaseManager = stubs . get ( 'inventory' ) ;
714+ const stub = sandbox . stub ( inventory , 'remove' ) . withArgs ( message ) ;
715+
716+ await subscriber . nackWithResponse ( message ) ;
717+
718+ assert . strictEqual ( stub . callCount , 1 ) ;
719+ } ) ;
720+ } ) ;
721+
722+ describe ( 'ackWithResponse' , ( ) => {
701723 it ( 'should modAck the message with a 0 deadline' , async ( ) => {
702724 const stub = sandbox . stub ( subscriber , 'modAck' ) ;
703725
704- await subscriber . nack ( message ) ;
726+ await subscriber . ackWithResponse ( message ) ;
705727
706728 const [ msg , deadline ] = stub . lastCall . args ;
707729
@@ -713,7 +735,7 @@ describe('Subscriber', () => {
713735 const inventory : FakeLeaseManager = stubs . get ( 'inventory' ) ;
714736 const stub = sandbox . stub ( inventory , 'remove' ) . withArgs ( message ) ;
715737
716- await subscriber . nack ( message ) ;
738+ await subscriber . ackWithResponse ( message ) ;
717739
718740 assert . strictEqual ( stub . callCount , 1 ) ;
719741 } ) ;
0 commit comments