@@ -918,13 +918,22 @@ describe('Subscriber', () => {
918918 } ) ;
919919
920920 describe ( 'nack' , ( ) => {
921- it ( 'should modAck the message with a 0 deadline' , async ( ) => {
921+ it ( 'should modAck the message with a 0 deadline (nack) ' , async ( ) => {
922922 const stub = sandbox . stub ( subscriber , 'modAck' ) ;
923923
924924 await subscriber . nack ( message ) ;
925925
926926 const [ msg , deadline ] = stub . lastCall . args ;
927+ assert . strictEqual ( msg , message ) ;
928+ assert . strictEqual ( deadline , 0 ) ;
929+ } ) ;
930+
931+ it ( 'should modAck the message with a 0 deadline (nackWithResponse)' , async ( ) => {
932+ const stub = sandbox . stub ( subscriber , 'modAckWithResponse' ) ;
927933
934+ await subscriber . nackWithResponse ( message ) ;
935+
936+ const [ msg , deadline ] = stub . lastCall . args ;
928937 assert . strictEqual ( msg , message ) ;
929938 assert . strictEqual ( deadline , 0 ) ;
930939 } ) ;
@@ -942,14 +951,23 @@ describe('Subscriber', () => {
942951 assert . strictEqual ( fakeLog . args ! [ 1 ] , message . id ) ;
943952 } ) ;
944953
945- it ( 'should remove the message from the inventory' , async ( ) => {
954+ it ( 'should remove the message from the inventory (nack) ' , async ( ) => {
946955 const inventory : FakeLeaseManager = stubs . get ( 'inventory' ) ;
947956 const stub = sandbox . stub ( inventory , 'remove' ) . withArgs ( message ) ;
948957
949958 await subscriber . nack ( message ) ;
950959
951960 assert . strictEqual ( stub . callCount , 1 ) ;
952961 } ) ;
962+
963+ it ( 'should remove the message from the inventory (nackWithResponse)' , async ( ) => {
964+ const inventory : FakeLeaseManager = stubs . get ( 'inventory' ) ;
965+ const stub = sandbox . stub ( inventory , 'remove' ) . withArgs ( message ) ;
966+
967+ await subscriber . nackWithResponse ( message ) ;
968+
969+ assert . strictEqual ( stub . callCount , 1 ) ;
970+ } ) ;
953971 } ) ;
954972
955973 describe ( 'open' , ( ) => {
0 commit comments