@flakiness/vitest 1.9.0 → 1.9.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.
Files changed (2) hide show
  1. package/lib/reporter.js +7 -4
  2. package/package.json +1 -1
package/lib/reporter.js CHANGED
@@ -16921,7 +16921,7 @@ import * as nodeUtil from "node:util";
16921
16921
  // package.json
16922
16922
  var package_default = {
16923
16923
  name: "@flakiness/vitest",
16924
- version: "1.9.0",
16924
+ version: "1.9.2",
16925
16925
  packageManager: "pnpm@11.5.0",
16926
16926
  description: "",
16927
16927
  main: "lib/reporter.js",
@@ -17140,16 +17140,19 @@ var ReporterImpl = class _ReporterImpl {
17140
17140
  }
17141
17141
  const startTime = testCase.diagnostic()?.startTime ?? this._startTimestamp;
17142
17142
  const duration3 = testCase.diagnostic()?.duration ?? testCase.module.diagnostic()?.duration ?? 0;
17143
- const retryCount = testCase.diagnostic()?.retryCount ?? 0;
17143
+ const retryCount = testCase.options.fails ? 0 : testCase.diagnostic()?.retryCount ?? 0;
17144
17144
  const stdio = [];
17145
17145
  let ts = startTime;
17146
17146
  for (const entry of this._stdio.get(testCase.id) ?? []) {
17147
17147
  stdio.push({
17148
17148
  text: entry.content,
17149
17149
  stream: entry.type === "stdout" ? FlakinessReport.STREAM_STDOUT : FlakinessReport.STREAM_STDERR,
17150
- dts: entry.time - ts
17150
+ // Older Vitest versions can report a stale timestamp when output
17151
+ // switches between stdout and stderr. Preserve the emitted order, but
17152
+ // never serialize an invalid negative DurationMS.
17153
+ dts: Math.max(0, entry.time - ts)
17151
17154
  });
17152
- ts = entry.time;
17155
+ ts = Math.max(ts, entry.time);
17153
17156
  }
17154
17157
  this._stdio.delete(testCase.id);
17155
17158
  const testFile = this._worktree.gitPath(testCase.module.moduleId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flakiness/vitest",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "description": "",
5
5
  "main": "lib/reporter.js",
6
6
  "keywords": [],