newman-reporter-qase 2.1.3 → 2.1.5

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/changelog.md CHANGED
@@ -1,3 +1,17 @@
1
+ # qase-newman@2.1.5
2
+
3
+ ## What's new
4
+
5
+ - Added support for status filter in the test run.
6
+ - Improved error handling.
7
+
8
+ # qase-newman@2.1.4
9
+
10
+ ## What's new
11
+
12
+ Fixed an issue where the start and end times were not properly set in the test results. Now results correctly display the
13
+ start and end times.
14
+
1
15
  # qase-newman@2.1.1
2
16
 
3
17
  ## What's new
package/dist/reporter.js CHANGED
@@ -175,7 +175,8 @@ class NewmanQaseReporter {
175
175
  const { item } = exec;
176
176
  const pendingResult = this.pendingResultMap.get(item.id);
177
177
  if (pendingResult && err) {
178
- pendingResult.execution.status = qase_javascript_commons_1.TestStatusEnum.failed;
178
+ // Determine status based on error type
179
+ pendingResult.execution.status = (0, qase_javascript_commons_1.determineTestStatus)(err, 'failed');
179
180
  pendingResult.execution.stacktrace = err.stack ?? null;
180
181
  pendingResult.message = err.message;
181
182
  }
@@ -187,12 +188,25 @@ class NewmanQaseReporter {
187
188
  const timer = this.timerMap.get(item.id);
188
189
  if (timer) {
189
190
  const now = Date.now();
190
- pendingResult.execution.duration = now - timer;
191
- pendingResult.execution.start_time = timer / 1000;
192
- pendingResult.execution.end_time = now / 1000;
191
+ const durationMs = now - timer;
192
+ // Ensure duration is not negative and times are valid
193
+ if (durationMs >= 0) {
194
+ pendingResult.execution.duration = Math.round(durationMs);
195
+ pendingResult.execution.start_time = timer / 1000;
196
+ pendingResult.execution.end_time = now / 1000;
197
+ }
198
+ else {
199
+ // Fallback for edge cases where timer might be incorrect
200
+ pendingResult.execution.duration = 0;
201
+ pendingResult.execution.start_time = now / 1000;
202
+ pendingResult.execution.end_time = now / 1000;
203
+ }
193
204
  }
194
205
  pendingResult.params = this.prepareParameters(item, exec.cursor.iteration);
195
206
  void this.reporter.addTestResult(pendingResult);
207
+ // Clean up timer and pending result after processing
208
+ this.timerMap.delete(item.id);
209
+ this.pendingResultMap.delete(item.id);
196
210
  }
197
211
  });
198
212
  runner.on('beforeDone', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newman-reporter-qase",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Qase TMS Newman Reporter",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  "author": "Qase Team <support@qase.io>",
40
40
  "license": "Apache-2.0",
41
41
  "dependencies": {
42
- "qase-javascript-commons": "~2.4.1",
42
+ "qase-javascript-commons": "~2.4.2",
43
43
  "semver": "^7.5.1"
44
44
  },
45
45
  "devDependencies": {