diff options
author | Simon Knox <psimyn@gmail.com> | 2017-11-02 14:13:34 +0300 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-11-02 14:15:33 +0300 |
commit | 970386e60364ea12489b0fbaadc6003701af85bc (patch) | |
tree | eaab67fe19150907b9baa3f21f0dcbbd7c0ea7cb /spec/javascripts/smart_interval_spec.js | |
parent | 17f2ba7facb64268ef14f6c29e79cf0e240c78d9 (diff) |
review feedback - throw error in smart_callback catch block
Diffstat (limited to 'spec/javascripts/smart_interval_spec.js')
-rw-r--r-- | spec/javascripts/smart_interval_spec.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/javascripts/smart_interval_spec.js b/spec/javascripts/smart_interval_spec.js index 48d7f252b80..1c87fcec245 100644 --- a/spec/javascripts/smart_interval_spec.js +++ b/spec/javascripts/smart_interval_spec.js @@ -58,16 +58,19 @@ describe('SmartInterval', function () { }, DEFAULT_LONG_TIMEOUT); }); - it('does not increment while waiting for callback', function (done) { + it('does not increment while waiting for callback', function () { + jasmine.clock().install(); + const smartInterval = createDefaultSmartInterval({ callback: () => new Promise($.noop), }); - setTimeout(() => { - const oneInterval = smartInterval.cfg.startingInterval * DEFAULT_INCREMENT_FACTOR; - expect(smartInterval.getCurrentInterval()).toEqual(oneInterval); - done(); - }, DEFAULT_SHORT_TIMEOUT); + jasmine.clock().tick(DEFAULT_SHORT_TIMEOUT); + + const oneInterval = smartInterval.cfg.startingInterval * DEFAULT_INCREMENT_FACTOR; + expect(smartInterval.getCurrentInterval()).toEqual(oneInterval); + + jasmine.clock().uninstall(); }); }); |