aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/test
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-07-04 18:07:05 +0800
committerJacob Evans <jacob@dekz.net>2018-07-04 18:29:54 +0800
commit5915f8430c252a341cac9c5ef645836efd4d7e92 (patch)
tree2d973f3b39d19247855a6320cc48858f0011df40 /packages/subproviders/test
parent9e0f06d06055022fff80bbf7a8b6444f72f898ec (diff)
parentaeea3817a48473aec0eb378b0ad6cbe7e7877044 (diff)
downloaddexon-sol-tools-5915f8430c252a341cac9c5ef645836efd4d7e92.tar
dexon-sol-tools-5915f8430c252a341cac9c5ef645836efd4d7e92.tar.gz
dexon-sol-tools-5915f8430c252a341cac9c5ef645836efd4d7e92.tar.bz2
dexon-sol-tools-5915f8430c252a341cac9c5ef645836efd4d7e92.tar.lz
dexon-sol-tools-5915f8430c252a341cac9c5ef645836efd4d7e92.tar.xz
dexon-sol-tools-5915f8430c252a341cac9c5ef645836efd4d7e92.tar.zst
dexon-sol-tools-5915f8430c252a341cac9c5ef645836efd4d7e92.zip
Merge branch 'v2-prototype' into eth-lightwallet-subprovider-final
Diffstat (limited to 'packages/subproviders/test')
-rw-r--r--packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
index 593027849..810fb8f45 100644
--- a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
+++ b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
@@ -1,6 +1,7 @@
import { DoneCallback } from '@0xproject/types';
import * as chai from 'chai';
import { JSONRPCResponsePayload } from 'ethereum-types';
+import * as Sinon from 'sinon';
import Web3ProviderEngine = require('web3-provider-engine');
import RpcSubprovider = require('web3-provider-engine/subproviders/rpc');
@@ -41,6 +42,9 @@ describe('RedundantSubprovider', () => {
const nonExistentSubprovider = new RpcSubprovider({
rpcUrl: 'http://does-not-exist:3000',
});
+ const handleRequestStub = Sinon.stub(nonExistentSubprovider, 'handleRequest').throws(
+ new Error('REQUEST_FAILED'),
+ );
const subproviders = [nonExistentSubprovider as Subprovider, ganacheSubprovider];
const redundantSubprovider = new RedundantSubprovider(subproviders);
provider.addProvider(redundantSubprovider);
@@ -55,6 +59,7 @@ describe('RedundantSubprovider', () => {
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.length).to.be.equal(DEFAULT_NUM_ACCOUNTS);
+ handleRequestStub.restore();
done();
});
provider.sendAsync(payload, callback);