Created
May 12, 2019 20:35
-
-
Save beshur/e01836db7f7ff8ffb073eb696a578b29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('RequestRepeater functions', function() { | |
it('should make request and repeat it at least once', function(done) { | |
const requestRepeater = new RequestRepeater({ | |
request: MOCK_REQUEST, | |
delay: 1000 | |
}) | |
let times = 0; | |
requestRepeater.requestAndRepeat() | |
requestRepeater.on('result', (result, error) => { | |
times++ | |
if (times > 1) { | |
requestRepeater.stopTimer() | |
} | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment