newman-reporter-qase 2.1.3 → 2.1.4

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,10 @@
1
+ # qase-newman@2.1.4
2
+
3
+ ## What's new
4
+
5
+ Fixed an issue where the start and end times were not properly set in the test results. Now results correctly display the
6
+ start and end times.
7
+
1
8
  # qase-newman@2.1.1
2
9
 
3
10
  ## What's new
package/dist/reporter.js CHANGED
@@ -187,12 +187,25 @@ class NewmanQaseReporter {
187
187
  const timer = this.timerMap.get(item.id);
188
188
  if (timer) {
189
189
  const now = Date.now();
190
- pendingResult.execution.duration = now - timer;
191
- pendingResult.execution.start_time = timer / 1000;
192
- pendingResult.execution.end_time = now / 1000;
190
+ const durationMs = now - timer;
191
+ // Ensure duration is not negative and times are valid
192
+ if (durationMs >= 0) {
193
+ pendingResult.execution.duration = Math.round(durationMs);
194
+ pendingResult.execution.start_time = timer / 1000;
195
+ pendingResult.execution.end_time = now / 1000;
196
+ }
197
+ else {
198
+ // Fallback for edge cases where timer might be incorrect
199
+ pendingResult.execution.duration = 0;
200
+ pendingResult.execution.start_time = now / 1000;
201
+ pendingResult.execution.end_time = now / 1000;
202
+ }
193
203
  }
194
204
  pendingResult.params = this.prepareParameters(item, exec.cursor.iteration);
195
205
  void this.reporter.addTestResult(pendingResult);
206
+ // Clean up timer and pending result after processing
207
+ this.timerMap.delete(item.id);
208
+ this.pendingResultMap.delete(item.id);
196
209
  }
197
210
  });
198
211
  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.4",
4
4
  "description": "Qase TMS Newman Reporter",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",