Skip to content

Commit

Permalink
Add empty response test
Browse files Browse the repository at this point in the history
  • Loading branch information
kajoseph committed Jun 29, 2021
1 parent 873053f commit d4f2e07
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/bitcore-node/test/unit/modules/ripple/csp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down

0 comments on commit d4f2e07

Please sign in to comment.