aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/test/expiration_watcher_test.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-05 22:33:00 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-10 18:24:37 +0800
commitc8c86c44f8b978d74e03c11d4bb1813e76574af3 (patch)
tree3caa7b2613496052ca90176822ace79fc28dcc44 /packages/0x.js/test/expiration_watcher_test.ts
parentf917a4a34a9d7b25de85f9ce5adafa0f16ea6618 (diff)
downloaddexon-0x-contracts-c8c86c44f8b978d74e03c11d4bb1813e76574af3.tar.gz
dexon-0x-contracts-c8c86c44f8b978d74e03c11d4bb1813e76574af3.tar.zst
dexon-0x-contracts-c8c86c44f8b978d74e03c11d4bb1813e76574af3.zip
Fix callback types
Diffstat (limited to 'packages/0x.js/test/expiration_watcher_test.ts')
-rw-r--r--packages/0x.js/test/expiration_watcher_test.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/0x.js/test/expiration_watcher_test.ts b/packages/0x.js/test/expiration_watcher_test.ts
index e7ba3533a..770615f88 100644
--- a/packages/0x.js/test/expiration_watcher_test.ts
+++ b/packages/0x.js/test/expiration_watcher_test.ts
@@ -15,7 +15,7 @@ import { utils } from '../src/utils/utils';
import { chaiSetup } from './utils/chai_setup';
import { constants as testConstants } from './utils/constants';
import { FillScenarios } from './utils/fill_scenarios';
-import { reportCallbackErrors } from './utils/report_callback_errors';
+import { reportNoErrorCallbackErrors } from './utils/report_callback_errors';
import { TokenUtils } from './utils/token_utils';
import { web3Factory } from './utils/web3_factory';
@@ -87,10 +87,9 @@ describe('ExpirationWatcher', () => {
);
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(1000));
- const callbackAsync = reportCallbackErrors(done)(async (hash: string) => {
+ const callbackAsync = reportNoErrorCallbackErrors(done)((hash: string) => {
expect(hash).to.be.equal(orderHash);
expect(utils.getCurrentUnixTimestampSec()).to.be.bignumber.gte(expirationUnixTimestampSec);
- done();
});
expirationWatcher.subscribe(callbackAsync);
timer.tick(orderLifetimeSec * 1000);
@@ -110,7 +109,7 @@ describe('ExpirationWatcher', () => {
);
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(1000));
- const callbackAsync = reportCallbackErrors(done)(async (hash: string) => {
+ const callbackAsync = reportNoErrorCallbackErrors(done)(async (hash: string) => {
done(new Error('Emitted expiration went before the order actually expired'));
});
expirationWatcher.subscribe(callbackAsync);
@@ -146,7 +145,8 @@ describe('ExpirationWatcher', () => {
expirationWatcher.addOrder(orderHash2, signedOrder2.expirationUnixTimestampSec.times(1000));
expirationWatcher.addOrder(orderHash1, signedOrder1.expirationUnixTimestampSec.times(1000));
const expirationOrder = [orderHash1, orderHash2];
- const callbackAsync = reportCallbackErrors(done)(async (hash: string) => {
+ const expectToBeCalledOnce = false;
+ const callbackAsync = reportNoErrorCallbackErrors(done, expectToBeCalledOnce)((hash: string) => {
const orderHash = expirationOrder.shift();
expect(hash).to.be.equal(orderHash);
if (_.isEmpty(expirationOrder)) {