diff --git a/js/src/util/subscribe-to-events.spec.js b/js/src/util/subscribe-to-events.spec.js index bbb0d280d..a14d2b36e 100644 --- a/js/src/util/subscribe-to-events.spec.js +++ b/js/src/util/subscribe-to-events.spec.js @@ -95,21 +95,20 @@ describe('util/subscribe-to-events', () => { expect(api.eth.uninstallFilter.firstCall.args).to.eql([ 123 ]); }); - it.skip('checks for new events regularly', async function () { + it('checks for new events regularly', async function () { const { api, contract } = this; api.eth.getFilterLogs = stub().resolves([]); const onLog = spy(); const onBar = spy(); - const s = subscribeToEvents(contract, [ 'Bar' ], { interval: 5 }) + subscribeToEvents(contract, [ 'Bar' ], { interval: 5 }) .on('log', onLog) .on('Bar', onBar); - await delay(9); - s.unsubscribe(); + await delay(10); - expect(onLog.callCount).to.equal(1); + expect(onLog.callCount).to.be.at.least(1); expect(onLog.firstCall.args).to.eql([ liveLogs[0] ]); - expect(onBar.callCount).to.equal(1); + expect(onBar.callCount).to.be.at.least(1); expect(onBar.firstCall.args).to.eql([ liveLogs[0] ]); }); });