@getjones/test-infra 4.5.26 → 4.5.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getjones/test-infra",
3
- "version": "4.5.26",
3
+ "version": "4.5.27",
4
4
  "description": "Providing internal and openapi interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "axios": "^0.21.1",
13
+ "axios": "^1.8.1",
14
14
  "axios-file": "^1.0.17",
15
15
  "chai": "^4.3.4",
16
16
  "dotenv": "^8.2.0",
@@ -104,13 +104,18 @@ const getLastMessage = async (
104
104
  }
105
105
  );
106
106
 
107
- const response = await getAllMessages(emailModel);
107
+ let retries = 2;
108
108
 
109
- if (response.status !== httpResponseStatusCodes.OK) {
110
- throw new Error(`Inbox messages could not be retrieved\n${response}`);
111
- }
109
+ while (!newestResult && retries--) {
110
+ await timeUtils.waitFor(1).seconds;
111
+ const response = await getAllMessages(emailModel);
112
+
113
+ if (response.status !== httpResponseStatusCodes.OK) {
114
+ throw new Error(`Inbox messages could not be retrieved\n${response}`);
115
+ }
112
116
 
113
- await getLatestMessage(response.data);
117
+ await getLatestMessage(response.data);
118
+ }
114
119
 
115
120
  if (newestId) {
116
121
  util.logRetrievedEmailInfo(newestTo, newestSubject, { cc: newestCc });
@@ -81,7 +81,7 @@ const getPolicyFilesIfExist = async (recordId, context) => {
81
81
 
82
82
  while (policyFiles.length === 0 && retries > 0) {
83
83
  //Busy wait for it takes time to get policy file to review
84
- await timeUtils.waitFor(1.5).seconds;
84
+ await timeUtils.waitFor(5).seconds;
85
85
 
86
86
  policiesToReviewResponse = await policyFileApi.getPolicyFilesRequireAudit(recordId, context);
87
87
  policyFiles = policiesToReviewResponse.data;