Fix tests

This commit is contained in:
Leonid Logvinov
2018-02-09 10:33:33 +01:00
parent 98b78c56c5
commit 49375c73d4
5 changed files with 13 additions and 9 deletions

View File

@@ -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', () => {