@webex/test-helper-retry 2.42.0 → 2.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["require","polyfill","backoffPattern","retry","fn","reduce","promise","delay","catch","err","resolve","console","error","setTimeout","reject","timeout","estimate","sum","next","module","exports"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable max-nested-callbacks */\n\n/* istanbul ignore next */\nif (typeof Promise === 'undefined') {\n // eslint-disable-next-line global-require\n require('es6-promise').polyfill();\n}\n\nconst backoffPattern = [0, 1000, 2000, 4000, 8000, 16000, 32000, 32000, 32000];\n\n/**\n * @param {Function} fn\n * @returns {Object}\n */\nfunction retry(fn) {\n return backoffPattern.reduce(\n (promise, delay) =>\n promise.catch(\n (err) =>\n new Promise((resolve) => {\n if (err) {\n console.error(`###Test error: ${err}. Retrying test in ${delay} seconds`);\n }\n\n setTimeout(() => {\n resolve(fn());\n }, delay);\n })\n ),\n Promise.reject()\n );\n}\n\n/**\n * Determines the expected timeout for the test.\n * @param {number} estimate estimated of how long a single attempt should take\n * @returns {number}\n */\nfunction timeout(estimate) {\n return backoffPattern.reduce((sum, next) => sum + next + estimate, 0);\n}\n\nmodule.exports = retry;\nretry.timeout = timeout;\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,uBAAc,KAAK,WAAW,EAAE;EAClC;EACAA,OAAO,CAAC,aAAa,CAAC,CAACC,QAAQ,EAAE;AACnC;AAEA,IAAMC,cAAc,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;;AAE9E;AACA;AACA;AACA;AACA,SAASC,KAAK,CAACC,EAAE,EAAE;EACjB,OAAOF,cAAc,CAACG,MAAM,CAC1B,UAACC,OAAO,EAAEC,KAAK;IAAA,OACbD,OAAO,CAACE,KAAK,CACX,UAACC,GAAG;MAAA,OACF,qBAAY,UAACC,OAAO,EAAK;QACvB,IAAID,GAAG,EAAE;UACPE,OAAO,CAACC,KAAK,0BAAmBH,GAAG,gCAAsBF,KAAK,cAAW;QAC3E;QAEAM,UAAU,CAAC,YAAM;UACfH,OAAO,CAACN,EAAE,EAAE,CAAC;QACf,CAAC,EAAEG,KAAK,CAAC;MACX,CAAC,CAAC;IAAA,EACL;EAAA,GACH,iBAAQO,MAAM,EAAE,CACjB;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,OAAO,CAACC,QAAQ,EAAE;EACzB,OAAOd,cAAc,CAACG,MAAM,CAAC,UAACY,GAAG,EAAEC,IAAI;IAAA,OAAKD,GAAG,GAAGC,IAAI,GAAGF,QAAQ;EAAA,GAAE,CAAC,CAAC;AACvE;AAEAG,MAAM,CAACC,OAAO,GAAGjB,KAAK;AACtBA,KAAK,CAACY,OAAO,GAAGA,OAAO"}
1
+ {"version":3,"names":["_promise","default","require","polyfill","backoffPattern","retry","fn","reduce","promise","delay","catch","err","resolve","console","error","concat","setTimeout","reject","timeout","estimate","sum","next","module","exports"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable max-nested-callbacks */\n\n/* istanbul ignore next */\nif (typeof Promise === 'undefined') {\n // eslint-disable-next-line global-require\n require('es6-promise').polyfill();\n}\n\nconst backoffPattern = [0, 1000, 2000, 4000, 8000, 16000, 32000, 32000, 32000];\n\n/**\n * @param {Function} fn\n * @returns {Object}\n */\nfunction retry(fn) {\n return backoffPattern.reduce(\n (promise, delay) =>\n promise.catch(\n (err) =>\n new Promise((resolve) => {\n if (err) {\n console.error(`###Test error: ${err}. Retrying test in ${delay} seconds`);\n }\n\n setTimeout(() => {\n resolve(fn());\n }, delay);\n })\n ),\n Promise.reject()\n );\n}\n\n/**\n * Determines the expected timeout for the test.\n * @param {number} estimate estimated of how long a single attempt should take\n * @returns {number}\n */\nfunction timeout(estimate) {\n return backoffPattern.reduce((sum, next) => sum + next + estimate, 0);\n}\n\nmodule.exports = retry;\nretry.timeout = timeout;\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,OAAAA,QAAA,CAAAC,OAAc,KAAK,WAAW,EAAE;EAClC;EACAC,OAAO,CAAC,aAAa,CAAC,CAACC,QAAQ,EAAE;AACnC;AAEA,IAAMC,cAAc,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;;AAE9E;AACA;AACA;AACA;AACA,SAASC,KAAKA,CAACC,EAAE,EAAE;EACjB,OAAOF,cAAc,CAACG,MAAM,CAC1B,UAACC,OAAO,EAAEC,KAAK;IAAA,OACbD,OAAO,CAACE,KAAK,CACX,UAACC,GAAG;MAAA,OACF,IAAAX,QAAA,CAAAC,OAAA,CAAY,UAACW,OAAO,EAAK;QACvB,IAAID,GAAG,EAAE;UACPE,OAAO,CAACC,KAAK,mBAAAC,MAAA,CAAmBJ,GAAG,yBAAAI,MAAA,CAAsBN,KAAK,cAAW;QAC3E;QAEAO,UAAU,CAAC,YAAM;UACfJ,OAAO,CAACN,EAAE,EAAE,CAAC;QACf,CAAC,EAAEG,KAAK,CAAC;MACX,CAAC,CAAC;IAAA,EACL;EAAA,GACHT,QAAA,CAAAC,OAAA,CAAQgB,MAAM,EAAE,CACjB;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,OAAOA,CAACC,QAAQ,EAAE;EACzB,OAAOf,cAAc,CAACG,MAAM,CAAC,UAACa,GAAG,EAAEC,IAAI;IAAA,OAAKD,GAAG,GAAGC,IAAI,GAAGF,QAAQ;EAAA,GAAE,CAAC,CAAC;AACvE;AAEAG,MAAM,CAACC,OAAO,GAAGlB,KAAK;AACtBA,KAAK,CAACa,OAAO,GAAGA,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/test-helper-retry",
3
- "version": "2.42.0",
3
+ "version": "2.43.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",