diff options
Diffstat (limited to 'test/order_state_watcher_test.ts')
-rw-r--r-- | test/order_state_watcher_test.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/order_state_watcher_test.ts b/test/order_state_watcher_test.ts index 5569d2354..913ccf602 100644 --- a/test/order_state_watcher_test.ts +++ b/test/order_state_watcher_test.ts @@ -84,6 +84,20 @@ describe('OrderStateWatcher', () => { zeroEx.orderStateWatcher.removeOrder(nonExistentOrderHash); }); }); + describe('#subscribe', async () => { + afterEach(async () => { + zeroEx.orderStateWatcher.unsubscribe(); + }); + it('should fail when trying to subscribe twice', (done: DoneCallback) => { + zeroEx.orderStateWatcher.subscribe(_.noop); + try { + zeroEx.orderStateWatcher.subscribe(_.noop); + done(new Error('Expected the second subscription to fail')); + } catch (err) { + done(); + } + }); + }); describe('tests with cleanup', async () => { afterEach(async () => { zeroEx.orderStateWatcher.unsubscribe(); |