aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-04-11 20:59:30 +0800
committerFabio Berger <me@fabioberger.com>2018-04-11 20:59:30 +0800
commitb146acc69e46d2565474bcb4d47bfa760fd26fad (patch)
treee6d4e200e55a59b6cbbf224121ca64d03261b11d /packages/0x.js
parent29dc22e208080fa8ff0871b98b530a2deb251a73 (diff)
downloaddexon-sol-tools-b146acc69e46d2565474bcb4d47bfa760fd26fad.tar
dexon-sol-tools-b146acc69e46d2565474bcb4d47bfa760fd26fad.tar.gz
dexon-sol-tools-b146acc69e46d2565474bcb4d47bfa760fd26fad.tar.bz2
dexon-sol-tools-b146acc69e46d2565474bcb4d47bfa760fd26fad.tar.lz
dexon-sol-tools-b146acc69e46d2565474bcb4d47bfa760fd26fad.tar.xz
dexon-sol-tools-b146acc69e46d2565474bcb4d47bfa760fd26fad.tar.zst
dexon-sol-tools-b146acc69e46d2565474bcb4d47bfa760fd26fad.zip
Simplify the tests
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/test/0x.js_test.ts5
-rw-r--r--packages/0x.js/test/ether_token_wrapper_test.ts3
-rw-r--r--packages/0x.js/test/exchange_wrapper_test.ts3
-rw-r--r--packages/0x.js/test/token_wrapper_test.ts3
4 files changed, 5 insertions, 9 deletions
diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts
index 5720f42ce..de5a6be58 100644
--- a/packages/0x.js/test/0x.js_test.ts
+++ b/packages/0x.js/test/0x.js_test.ts
@@ -42,10 +42,9 @@ describe('ZeroEx library', () => {
expect((zeroEx.exchange as any)._exchangeContractIfExists).to.not.be.undefined();
expect((zeroEx.tokenRegistry as any)._tokenRegistryContractIfExists).to.not.be.undefined();
- const newProvider = provider;
// Add property to newProvider so that we can differentiate it from old provider
- (newProvider as any).zeroExTestId = 1;
- zeroEx.setProvider(newProvider, constants.TESTRPC_NETWORK_ID);
+ (provider as any).zeroExTestId = 1;
+ zeroEx.setProvider(provider, constants.TESTRPC_NETWORK_ID);
// Check that contractInstances with old provider are removed after provider update
expect((zeroEx.exchange as any)._exchangeContractIfExists).to.be.undefined();
diff --git a/packages/0x.js/test/ether_token_wrapper_test.ts b/packages/0x.js/test/ether_token_wrapper_test.ts
index e1ae34edb..99c42fe0b 100644
--- a/packages/0x.js/test/ether_token_wrapper_test.ts
+++ b/packages/0x.js/test/ether_token_wrapper_test.ts
@@ -260,8 +260,7 @@ describe('EtherTokenWrapper', () => {
callbackNeverToBeCalled,
);
const callbackToBeCalled = reportNodeCallbackErrors(done)();
- const newProvider = provider;
- zeroEx.setProvider(newProvider, constants.TESTRPC_NETWORK_ID);
+ zeroEx.setProvider(provider, constants.TESTRPC_NETWORK_ID);
await zeroEx.etherToken.depositAsync(etherTokenAddress, transferAmount, addressWithETH);
zeroEx.etherToken.subscribe(
etherTokenAddress,
diff --git a/packages/0x.js/test/exchange_wrapper_test.ts b/packages/0x.js/test/exchange_wrapper_test.ts
index addfa6f91..cd74af5a1 100644
--- a/packages/0x.js/test/exchange_wrapper_test.ts
+++ b/packages/0x.js/test/exchange_wrapper_test.ts
@@ -976,8 +976,7 @@ describe('ExchangeWrapper', () => {
);
zeroEx.exchange.subscribe(ExchangeEvents.LogFill, indexFilterValues, callbackNeverToBeCalled);
- const newProvider = provider;
- zeroEx.setProvider(newProvider, constants.TESTRPC_NETWORK_ID);
+ zeroEx.setProvider(provider, constants.TESTRPC_NETWORK_ID);
const callback = reportNodeCallbackErrors(done)(
(logEvent: DecodedLogEvent<LogFillContractEventArgs>) => {
diff --git a/packages/0x.js/test/token_wrapper_test.ts b/packages/0x.js/test/token_wrapper_test.ts
index 63f17acf7..5a8e6d16f 100644
--- a/packages/0x.js/test/token_wrapper_test.ts
+++ b/packages/0x.js/test/token_wrapper_test.ts
@@ -425,8 +425,7 @@ describe('TokenWrapper', () => {
);
zeroEx.token.subscribe(tokenAddress, TokenEvents.Transfer, indexFilterValues, callbackNeverToBeCalled);
const callbackToBeCalled = reportNodeCallbackErrors(done)();
- const newProvider = provider;
- zeroEx.setProvider(newProvider, constants.TESTRPC_NETWORK_ID);
+ zeroEx.setProvider(provider, constants.TESTRPC_NETWORK_ID);
zeroEx.token.subscribe(tokenAddress, TokenEvents.Transfer, indexFilterValues, callbackToBeCalled);
await zeroEx.token.transferAsync(tokenAddress, coinbase, addressWithoutFunds, transferAmount);
})().catch(done);