aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher/test
diff options
context:
space:
mode:
authoramaurer <git@maurer.me>2018-10-08 00:24:42 +0800
committeramaurer <git@maurer.me>2018-10-08 00:24:42 +0800
commit2e1222556ff8bd3923a5e91174f7d6bd92d6a02c (patch)
tree5b3d05fe780a75c9c4b5842dced803e864782a81 /packages/order-watcher/test
parent9171f9ec600b04134e0f86741e60a973618839b5 (diff)
downloaddexon-sol-tools-2e1222556ff8bd3923a5e91174f7d6bd92d6a02c.tar
dexon-sol-tools-2e1222556ff8bd3923a5e91174f7d6bd92d6a02c.tar.gz
dexon-sol-tools-2e1222556ff8bd3923a5e91174f7d6bd92d6a02c.tar.bz2
dexon-sol-tools-2e1222556ff8bd3923a5e91174f7d6bd92d6a02c.tar.lz
dexon-sol-tools-2e1222556ff8bd3923a5e91174f7d6bd92d6a02c.tar.xz
dexon-sol-tools-2e1222556ff8bd3923a5e91174f7d6bd92d6a02c.tar.zst
dexon-sol-tools-2e1222556ff8bd3923a5e91174f7d6bd92d6a02c.zip
Changed getWatchedOrders to getStats and returns Stats object
Diffstat (limited to 'packages/order-watcher/test')
-rw-r--r--packages/order-watcher/test/order_watcher_test.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts
index f1dbe9b2f..4545f84bf 100644
--- a/packages/order-watcher/test/order_watcher_test.ts
+++ b/packages/order-watcher/test/order_watcher_test.ts
@@ -140,8 +140,8 @@ describe('OrderWatcher', () => {
expect(() => orderWatcher.subscribe(_.noop.bind(_))).to.throw(OrderWatcherError.SubscriptionAlreadyPresent);
});
});
- describe('#getWatchCount', async () => {
- it('should increment and decrement order counts', async () => {
+ describe('#getStats', async () => {
+ it('orderCount should increment and decrement with order additions and removals', async () => {
signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerAssetData,
takerAssetData,
@@ -150,11 +150,11 @@ describe('OrderWatcher', () => {
fillableAmount,
);
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
- expect(orderWatcher.getWatchCount()).to.be.eq(0);
+ expect(orderWatcher.getStats().orderCount).to.be.eq(0);
await orderWatcher.addOrderAsync(signedOrder);
- expect(orderWatcher.getWatchCount()).to.be.eq(1);
+ expect(orderWatcher.getStats().orderCount).to.be.eq(1);
orderWatcher.removeOrder(orderHash);
- expect(orderWatcher.getWatchCount()).to.be.eq(0);
+ expect(orderWatcher.getStats().orderCount).to.be.eq(0);
});
});
describe('tests with cleanup', async () => {