From cca65679d0084900599e4c705f0baccdbd47d0a0 Mon Sep 17 00:00:00 2001 From: nivida Date: Mon, 5 Aug 2019 15:08:35 +0200 Subject: [PATCH] AbstractSocketProviderTest updated --- .../tests/lib/providers/AbstractSocketProviderTest.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/web3-providers/tests/lib/providers/AbstractSocketProviderTest.js b/packages/web3-providers/tests/lib/providers/AbstractSocketProviderTest.js index 9be8e7f3bce..a2c879d679d 100644 --- a/packages/web3-providers/tests/lib/providers/AbstractSocketProviderTest.js +++ b/packages/web3-providers/tests/lib/providers/AbstractSocketProviderTest.js @@ -256,7 +256,7 @@ describe('AbstractSocketProviderTest', () => { }); it('calls clearSubscriptions and one unsubscribe call returns false', async () => { - abstractSocketProvider.subscriptions.set('0x0', {id: '0x0'}); + abstractSocketProvider.subscriptions.set('0x0', {id: '0x0', subscribeMethod: 'eth_subscribe'}); abstractSocketProvider.removeAllListeners = jest.fn(); abstractSocketProvider.send = jest.fn((subscribeMethod, parameters) => { @@ -270,12 +270,10 @@ describe('AbstractSocketProviderTest', () => { await expect(abstractSocketProvider.clearSubscriptions('eth_unsubscribe')).rejects.toThrow( `Could not unsubscribe all subscriptions: ${JSON.stringify([false])}` ); - - expect(abstractSocketProvider.removeAllListeners).toHaveBeenCalledWith('0x0'); }); it('calls clearSubscriptions and all unsubscribe calls are returning true', async () => { - abstractSocketProvider.subscriptions.set('0x0', {id: '0x0'}); + abstractSocketProvider.subscriptions.set('0x0', {id: '0x0', subscribeMethod: 'eth_subscribe'}); abstractSocketProvider.removeAllListeners = jest.fn(); abstractSocketProvider.send = jest.fn((subscribeMethod, parameters) => { @@ -290,8 +288,6 @@ describe('AbstractSocketProviderTest', () => { expect(response).toEqual(true); - expect(abstractSocketProvider.removeAllListeners).toHaveBeenCalledWith('0x0'); - expect(abstractSocketProvider.subscriptions).toEqual(new Map()); });