diff options
Diffstat (limited to 'packages/0x.js/test/ether_token_wrapper_test.ts')
-rw-r--r-- | packages/0x.js/test/ether_token_wrapper_test.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/0x.js/test/ether_token_wrapper_test.ts b/packages/0x.js/test/ether_token_wrapper_test.ts index da49ec467..72086dff0 100644 --- a/packages/0x.js/test/ether_token_wrapper_test.ts +++ b/packages/0x.js/test/ether_token_wrapper_test.ts @@ -75,11 +75,14 @@ describe('EtherTokenWrapper', () => { const contractAddressIfExists = zeroEx.etherToken.getContractAddressIfExists(); expect(contractAddressIfExists).to.not.be.undefined(); }); - it('should return undefined if connected to an unknown network', () => { + it('should throw if connected to a private network and contract addresses are not specified', () => { const UNKNOWN_NETWORK_NETWORK_ID = 10; - const unknownNetworkZeroEx = new ZeroEx(web3.currentProvider, { networkId: UNKNOWN_NETWORK_NETWORK_ID }); - const contractAddressIfExists = unknownNetworkZeroEx.etherToken.getContractAddressIfExists(); - expect(contractAddressIfExists).to.be.undefined(); + expect( + () => + new ZeroEx(web3.currentProvider, { + networkId: UNKNOWN_NETWORK_NETWORK_ID, + } as any), + ).to.throw(); }); }); describe('#depositAsync', () => { |