diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-13 09:49:48 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-13 09:49:48 +0800 |
commit | 442f35a1fdd98846d3985548b3de6f5c620e68a1 (patch) | |
tree | e498559ce452a0d1eddfc4df6224450492efa892 /test/exchange_wrapper_test.ts | |
parent | 6becf22a2f752ef7c34ce1b423efd51773cc5fde (diff) | |
parent | 1392a855bb17981f7680548a23062842fb6dc4e0 (diff) | |
download | dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.gz dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.bz2 dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.lz dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.xz dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.zst dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.zip |
Merge branch 'development' into orderWatcher
* development:
0.23.0
Update CHANGELOG
Fix amounts in tests one last time. Now that we updated the testRPC snapshot, this should no longer be mismatched between CI and locally
Update testRPC snapshot used by CircleCi
Push unsubscribe to the base class rather than super
Check for null rather than undefined
Removed nits
Test case was error then unsubscribe
Clean up subscription state.
Fix unhandled promise rejection error on subscriptions
# Conflicts:
# src/types.ts
# test/exchange_wrapper_test.ts
# test/token_wrapper_test.ts
Diffstat (limited to 'test/exchange_wrapper_test.ts')
-rw-r--r-- | test/exchange_wrapper_test.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index 20b9cf7fc..26b8c1e0e 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -647,7 +647,8 @@ describe('ExchangeWrapper', () => { // Source: https://github.com/mochajs/mocha/issues/2407 it('Should receive the LogFill event when an order is filled', (done: DoneCallback) => { (async () => { - const callback = (logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { + + const callback = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { expect(logEvent.event).to.be.equal(ExchangeEvents.LogFill); done(); }; @@ -662,7 +663,8 @@ describe('ExchangeWrapper', () => { }); it('Should receive the LogCancel event when an order is cancelled', (done: DoneCallback) => { (async () => { - const callback = (logEvent: DecodedLogEvent<LogCancelContractEventArgs>) => { + + const callback = (err: Error, logEvent: DecodedLogEvent<LogCancelContractEventArgs>) => { expect(logEvent.event).to.be.equal(ExchangeEvents.LogCancel); done(); }; @@ -674,7 +676,8 @@ describe('ExchangeWrapper', () => { }); it('Outstanding subscriptions are cancelled when zeroEx.setProviderAsync called', (done: DoneCallback) => { (async () => { - const callbackNeverToBeCalled = (logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { + + const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { done(new Error('Expected this subscription to have been cancelled')); }; await zeroEx.exchange.subscribeAsync( @@ -684,7 +687,7 @@ describe('ExchangeWrapper', () => { const newProvider = web3Factory.getRpcProvider(); await zeroEx.setProviderAsync(newProvider); - const callback = (logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { + const callback = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { expect(logEvent.event).to.be.equal(ExchangeEvents.LogFill); done(); }; @@ -699,7 +702,7 @@ describe('ExchangeWrapper', () => { }); it('Should cancel subscription when unsubscribe called', (done: DoneCallback) => { (async () => { - const callbackNeverToBeCalled = (logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { + const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { done(new Error('Expected this subscription to have been cancelled')); }; const subscriptionToken = await zeroEx.exchange.subscribeAsync( |