aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/test
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-02-26 10:32:12 +0800
committerFabio Berger <me@fabioberger.com>2018-02-26 10:32:12 +0800
commitfffaafe4c996ac0c458dd6cb9e3598b1d93b7aa4 (patch)
tree21f9398ba2975bda4706fb8f54c0c717b88ecfd4 /packages/0x.js/test
parent66b36f6d8f7c0f0487e53badb035ac50e1ec5669 (diff)
parent709fa9e02ec21cee9fc145b4a578742c8dd190aa (diff)
downloaddexon-sol-tools-fffaafe4c996ac0c458dd6cb9e3598b1d93b7aa4.tar
dexon-sol-tools-fffaafe4c996ac0c458dd6cb9e3598b1d93b7aa4.tar.gz
dexon-sol-tools-fffaafe4c996ac0c458dd6cb9e3598b1d93b7aa4.tar.bz2
dexon-sol-tools-fffaafe4c996ac0c458dd6cb9e3598b1d93b7aa4.tar.lz
dexon-sol-tools-fffaafe4c996ac0c458dd6cb9e3598b1d93b7aa4.tar.xz
dexon-sol-tools-fffaafe4c996ac0c458dd6cb9e3598b1d93b7aa4.tar.zst
dexon-sol-tools-fffaafe4c996ac0c458dd6cb9e3598b1d93b7aa4.zip
Merge branch 'development' into moveOutDocGenerator
* development: (36 commits) Fix english translations Fix footer on mobile re-add google analytics code Fix Russian translation Move all dependencies on @0xproject/types out of devDependencies Slight improvement to footer Fix a few Korean translations Address feedback Use source tree hash instead of compile flag Fix race condition Update CHANGELOG Delete artifacts directory Add generated contract artifacts to gitignore Check dependencies when determining if should be recompiled Update CHANGELOG Remove unused CHANGELOG entry Remove unused import Change assert.doesConformToShema interface Remove a type assertion Publish ...
Diffstat (limited to 'packages/0x.js/test')
-rw-r--r--packages/0x.js/test/ether_token_wrapper_test.ts11
-rw-r--r--packages/0x.js/test/expiration_watcher_test.ts2
2 files changed, 8 insertions, 5 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', () => {
diff --git a/packages/0x.js/test/expiration_watcher_test.ts b/packages/0x.js/test/expiration_watcher_test.ts
index b49dee8e5..7f79e3802 100644
--- a/packages/0x.js/test/expiration_watcher_test.ts
+++ b/packages/0x.js/test/expiration_watcher_test.ts
@@ -9,10 +9,10 @@ import * as Web3 from 'web3';
import { ZeroEx } from '../src/0x';
import { ExpirationWatcher } from '../src/order_watcher/expiration_watcher';
import { DoneCallback, Token } from '../src/types';
-import { constants } from '../src/utils/constants';
import { utils } from '../src/utils/utils';
import { chaiSetup } from './utils/chai_setup';
+import { constants } from './utils/constants';
import { FillScenarios } from './utils/fill_scenarios';
import { reportNoErrorCallbackErrors } from './utils/report_callback_errors';
import { TokenUtils } from './utils/token_utils';