source: trip-planner-front/node_modules/retry/test/integration/test-forever.js@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 515 bytes
Line 
1var common = require('../common');
2var assert = common.assert;
3var retry = require(common.dir.lib + '/retry');
4
5(function testForeverUsesFirstTimeout() {
6 var operation = retry.operation({
7 retries: 0,
8 minTimeout: 100,
9 maxTimeout: 100,
10 forever: true
11 });
12
13 operation.attempt(function(numAttempt) {
14 console.log('>numAttempt', numAttempt);
15 var err = new Error("foo");
16 if (numAttempt == 10) {
17 operation.stop();
18 }
19
20 if (operation.retry(err)) {
21 return;
22 }
23 });
24})();
Note: See TracBrowser for help on using the repository browser.