From f3e1797153ebf5b19ca3e154cf1240be738e4f08 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 4 Feb 2015 11:23:23 +0100 Subject: fixed jsonrpc response 0 not handled properly --- test/jsonrpc.isValidResponse.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/jsonrpc.isValidResponse.js') diff --git a/test/jsonrpc.isValidResponse.js b/test/jsonrpc.isValidResponse.js index 2fe200496..920b5f3a9 100644 --- a/test/jsonrpc.isValidResponse.js +++ b/test/jsonrpc.isValidResponse.js @@ -124,5 +124,20 @@ describe('jsonrpc', function () { assert.equal(valid, true); }); + it('should validate jsonrpc response with result field === 0', function () { + + // given + var response = { + jsonrpc: '2.0', + id: 1, + result: 0 + }; + + // when + var valid = jsonrpc.isValidResponse(response); + + // then + assert.equal(valid, true); + }); }); }); -- cgit