From d4f2e0770e4a777296a605f801d72decc96fa65a Mon Sep 17 00:00:00 2001 From: Kenny Joseph Date: Tue, 29 Jun 2021 15:13:53 -0400 Subject: [PATCH] Add empty response test --- packages/bitcore-node/test/unit/modules/ripple/csp.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/bitcore-node/test/unit/modules/ripple/csp.spec.ts b/packages/bitcore-node/test/unit/modules/ripple/csp.spec.ts index ea9819d7927..4eafca54661 100644 --- a/packages/bitcore-node/test/unit/modules/ripple/csp.spec.ts +++ b/packages/bitcore-node/test/unit/modules/ripple/csp.spec.ts @@ -45,6 +45,12 @@ describe('XRP Chain State Provider', () => { }); }); + it('should resolve on empty response', async () => { + requestStub.callsArgWith(1, null, null, null); + const res = await XRP.getBlockBeforeTime({ chain: 'XRP', network: 'testnet' }); + expect(res).to.be.null; + }); + it('should throw on invalid time', async () => { try { await XRP.getBlockBeforeTime({ chain: 'XRP', network: 'testnet', time: 'not-a-time' });