aboutsummaryrefslogtreecommitdiffstats
path: root/test/token_wrapper_test.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon@0xproject.com>2017-11-13 03:06:39 +0800
committerGitHub <noreply@github.com>2017-11-13 03:06:39 +0800
commit719c51f61a65e3e179ba2a78fa48105247ba2b41 (patch)
tree566c10ab457b45c5b1d535d78cece422ae24fdda /test/token_wrapper_test.ts
parent76b66872d8f797ee3b0efe0fa2ca914cf44ee46c (diff)
parentdae5a063cf1568676485d4dc0a0d97f0e7aa5daa (diff)
downloaddexon-sol-tools-719c51f61a65e3e179ba2a78fa48105247ba2b41.tar
dexon-sol-tools-719c51f61a65e3e179ba2a78fa48105247ba2b41.tar.gz
dexon-sol-tools-719c51f61a65e3e179ba2a78fa48105247ba2b41.tar.bz2
dexon-sol-tools-719c51f61a65e3e179ba2a78fa48105247ba2b41.tar.lz
dexon-sol-tools-719c51f61a65e3e179ba2a78fa48105247ba2b41.tar.xz
dexon-sol-tools-719c51f61a65e3e179ba2a78fa48105247ba2b41.tar.zst
dexon-sol-tools-719c51f61a65e3e179ba2a78fa48105247ba2b41.zip
Merge pull request #209 from 0xProject/fixUnhandledPromiseBug
Fix unhandled promise rejection error on subscriptions
Diffstat (limited to 'test/token_wrapper_test.ts')
-rw-r--r--test/token_wrapper_test.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts
index b35fa43f9..d9d0fb9ad 100644
--- a/test/token_wrapper_test.ts
+++ b/test/token_wrapper_test.ts
@@ -161,7 +161,7 @@ describe('TokenWrapper', () => {
const token = tokens[0];
const ownerAddress = coinbase;
const balance = await zeroEx.token.getBalanceAsync(token.address, ownerAddress);
- const expectedBalance = new BigNumber('100000000000000000000000000');
+ const expectedBalance = new BigNumber('1000000000000000000000000000');
return expect(balance).to.be.bignumber.equal(expectedBalance);
});
it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
@@ -189,7 +189,7 @@ describe('TokenWrapper', () => {
const token = tokens[0];
const ownerAddress = coinbase;
const balance = await zeroExWithoutAccounts.token.getBalanceAsync(token.address, ownerAddress);
- const expectedBalance = new BigNumber('100000000000000000000000000');
+ const expectedBalance = new BigNumber('1000000000000000000000000000');
return expect(balance).to.be.bignumber.equal(expectedBalance);
});
});
@@ -358,7 +358,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: LogEvent<TransferContractEventArgs>) => {
+ const callback = (err: Error, logEvent: LogEvent<TransferContractEventArgs>) => {
expect(logEvent).to.not.be.undefined();
const args = logEvent.args;
expect(args._from).to.be.equal(coinbase);
@@ -373,7 +373,7 @@ describe('TokenWrapper', () => {
});
it('Should receive the Approval event when allowance is being set', (done: DoneCallback) => {
(async () => {
- const callback = (logEvent: LogEvent<ApprovalContractEventArgs>) => {
+ const callback = (err: Error, logEvent: LogEvent<ApprovalContractEventArgs>) => {
expect(logEvent).to.not.be.undefined();
const args = logEvent.args;
expect(args._owner).to.be.equal(coinbase);
@@ -388,13 +388,13 @@ describe('TokenWrapper', () => {
});
it('Outstanding subscriptions are cancelled when zeroEx.setProviderAsync called', (done: DoneCallback) => {
(async () => {
- const callbackNeverToBeCalled = (logEvent: LogEvent<TransferContractEventArgs>) => {
+ const callbackNeverToBeCalled = (err: Error, logEvent: LogEvent<TransferContractEventArgs>) => {
done(new Error('Expected this subscription to have been cancelled'));
};
zeroEx.token.subscribe(
tokenAddress, TokenEvents.Transfer, indexFilterValues, callbackNeverToBeCalled,
);
- const callbackToBeCalled = (logEvent: LogEvent<TransferContractEventArgs>) => {
+ const callbackToBeCalled = (err: Error, logEvent: LogEvent<TransferContractEventArgs>) => {
done();
};
const newProvider = web3Factory.getRpcProvider();
@@ -407,7 +407,7 @@ describe('TokenWrapper', () => {
});
it('Should cancel subscription when unsubscribe called', (done: DoneCallback) => {
(async () => {
- const callbackNeverToBeCalled = (logEvent: LogEvent<TokenContractEventArgs>) => {
+ const callbackNeverToBeCalled = (err: Error, logEvent: LogEvent<TokenContractEventArgs>) => {
done(new Error('Expected this subscription to have been cancelled'));
};
const subscriptionToken = zeroEx.token.subscribe(