@mimik/request-retry 3.0.0 → 3.0.2
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/lib/rp-axios-wrapper.js +2 -2
- package/package.json +22 -23
- package/test/rpRetry.spec.js +2 -3
package/lib/rp-axios-wrapper.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const axios = require('axios');
|
|
2
|
-
const
|
|
2
|
+
const clone = require('lodash.clone');
|
|
3
3
|
|
|
4
4
|
const { getRichError } = require('@mimik/response-helper');
|
|
5
5
|
|
|
6
6
|
const rp = (origOptions) => {
|
|
7
|
-
const options =
|
|
7
|
+
const options = clone(origOptions);
|
|
8
8
|
|
|
9
9
|
if (options.uri) options.url = options.uri;
|
|
10
10
|
delete options.uri;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mimik/request-retry",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Request retry wrapping axios",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,32 +29,31 @@
|
|
|
29
29
|
"url": "https://bitbucket.org/mimiktech/request-retry"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mimik/request-helper": "^1.7.
|
|
33
|
-
"@mimik/response-helper": "^3.
|
|
34
|
-
"@mimik/sumologic-winston-logger": "^1.6.
|
|
35
|
-
"axios": "1.
|
|
32
|
+
"@mimik/request-helper": "^1.7.11",
|
|
33
|
+
"@mimik/response-helper": "^3.1.0",
|
|
34
|
+
"@mimik/sumologic-winston-logger": "^1.6.22",
|
|
35
|
+
"axios": "1.7.7",
|
|
36
36
|
"bluebird": "3.7.2",
|
|
37
|
-
"lodash": "4.
|
|
37
|
+
"lodash.clone": "4.5.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@mimik/eslint-plugin-dependencies": "^2.4.
|
|
41
|
-
"@mimik/eslint-plugin-document-env": "^1.0.
|
|
42
|
-
"acorn": "8.
|
|
43
|
-
"body-parser": "1.20.
|
|
44
|
-
"chai": "4.
|
|
45
|
-
"eslint": "8.
|
|
40
|
+
"@mimik/eslint-plugin-dependencies": "^2.4.6",
|
|
41
|
+
"@mimik/eslint-plugin-document-env": "^1.0.6",
|
|
42
|
+
"acorn": "8.12.1",
|
|
43
|
+
"body-parser": "1.20.3",
|
|
44
|
+
"chai": "4.5.0",
|
|
45
|
+
"eslint": "8.57.1",
|
|
46
46
|
"eslint-config-airbnb": "19.0.4",
|
|
47
|
-
"eslint-plugin-import": "2.
|
|
48
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
49
|
-
"eslint-plugin-react": "7.
|
|
50
|
-
"eslint-plugin-react-hooks": "4.6.
|
|
51
|
-
"express": "4.
|
|
52
|
-
"husky": "
|
|
53
|
-
"jsdoc-to-markdown": "
|
|
54
|
-
"mocha": "10.
|
|
47
|
+
"eslint-plugin-import": "2.31.0",
|
|
48
|
+
"eslint-plugin-jsx-a11y": "6.10.0",
|
|
49
|
+
"eslint-plugin-react": "7.37.1",
|
|
50
|
+
"eslint-plugin-react-hooks": "4.6.2",
|
|
51
|
+
"express": "4.21.0",
|
|
52
|
+
"husky": "9.1.6",
|
|
53
|
+
"jsdoc-to-markdown": "9.0.2",
|
|
54
|
+
"mocha": "10.7.3",
|
|
55
55
|
"mochawesome": "7.1.3",
|
|
56
|
-
"nyc": "
|
|
57
|
-
"sinon": "
|
|
58
|
-
"verror": "1.10.1"
|
|
56
|
+
"nyc": "17.1.0",
|
|
57
|
+
"sinon": "19.0.2"
|
|
59
58
|
}
|
|
60
59
|
}
|
package/test/rpRetry.spec.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const chai = require('chai');
|
|
2
2
|
const sinon = require('sinon');
|
|
3
|
-
const VError = require('verror');
|
|
4
3
|
const { beforeEach, afterEach } = require('mocha');
|
|
5
4
|
require('./testEnv');
|
|
6
5
|
|
|
@@ -335,7 +334,7 @@ describe('request-retry Unit Tests', () => {
|
|
|
335
334
|
return rpRetry(options)
|
|
336
335
|
.catch((err) => {
|
|
337
336
|
expect(err.name).to.equal('System');
|
|
338
|
-
expect(
|
|
337
|
+
expect(err.cause.name).to.equal('TimeoutError');
|
|
339
338
|
// sinon.assert.called(loggerSpyWarn);
|
|
340
339
|
});
|
|
341
340
|
});
|
|
@@ -352,7 +351,7 @@ describe('request-retry Unit Tests', () => {
|
|
|
352
351
|
})
|
|
353
352
|
.catch((err) => {
|
|
354
353
|
expect(err.name).to.equal('System');
|
|
355
|
-
expect(
|
|
354
|
+
expect(err.cause.name).to.equal('TimeoutError');
|
|
356
355
|
}));
|
|
357
356
|
});
|
|
358
357
|
});
|