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/token_wrapper_test.ts | |
parent | 6becf22a2f752ef7c34ce1b423efd51773cc5fde (diff) | |
parent | 1392a855bb17981f7680548a23062842fb6dc4e0 (diff) | |
download | dexon-0x-contracts-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar dexon-0x-contracts-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.gz dexon-0x-contracts-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.bz2 dexon-0x-contracts-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.lz dexon-0x-contracts-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.xz dexon-0x-contracts-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.zst dexon-0x-contracts-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/token_wrapper_test.ts')
-rw-r--r-- | test/token_wrapper_test.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 23020c47a..40652d03c 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -359,7 +359,7 @@ describe('TokenWrapper', () => { // Source: https://github.com/mochajs/mocha/issues/2407 it('Should receive the Transfer event when tokens are transfered', (done: DoneCallback) => { (async () => { - const callback = (logEvent: DecodedLogEvent<TransferContractEventArgs>) => { + const callback = (err: Error, logEvent: DecodedLogEvent<TransferContractEventArgs>) => { expect(logEvent).to.not.be.undefined(); const args = logEvent.args; expect(args._from).to.be.equal(coinbase); @@ -374,7 +374,7 @@ describe('TokenWrapper', () => { }); it('Should receive the Approval event when allowance is being set', (done: DoneCallback) => { (async () => { - const callback = (logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { + const callback = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { expect(logEvent).to.not.be.undefined(); const args = logEvent.args; expect(args._owner).to.be.equal(coinbase); @@ -389,13 +389,13 @@ describe('TokenWrapper', () => { }); it('Outstanding subscriptions are cancelled when zeroEx.setProviderAsync called', (done: DoneCallback) => { (async () => { - const callbackNeverToBeCalled = (logEvent: DecodedLogEvent<TransferContractEventArgs>) => { + const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { done(new Error('Expected this subscription to have been cancelled')); }; zeroEx.token.subscribe( tokenAddress, TokenEvents.Transfer, indexFilterValues, callbackNeverToBeCalled, ); - const callbackToBeCalled = (logEvent: DecodedLogEvent<TransferContractEventArgs>) => { + const callbackToBeCalled = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { done(); }; const newProvider = web3Factory.getRpcProvider(); @@ -408,7 +408,7 @@ describe('TokenWrapper', () => { }); it('Should cancel subscription when unsubscribe called', (done: DoneCallback) => { (async () => { - const callbackNeverToBeCalled = (logEvent: DecodedLogEvent<TokenContractEventArgs>) => { + const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { done(new Error('Expected this subscription to have been cancelled')); }; const subscriptionToken = zeroEx.token.subscribe( |