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 +7 -0
- package/dist/reporter.js +16 -3
- package/package.json +1 -1
package/changelog.md
CHANGED
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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', () => {
|