@cldmv/vitest-runner 1.0.1 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cldmv/vitest-runner",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Sequential Vitest runner to avoid OOM issues with large test suites",
5
5
  "type": "module",
6
6
  "main": "index.cjs",
@@ -186,12 +186,14 @@ export async function printCoverageSummary(cwd, extraCoverageArgs, worstCount =
186
186
  fns: data.functions?.pct ?? 0,
187
187
  branches: data.branches?.pct ?? 0
188
188
  }))
189
- .sort((a, b) => a.lines - b.lines);
189
+ .filter((r) => Math.min(r.lines, r.stmts, r.fns, r.branches) < 100)
190
+ .sort((a, b) => Math.min(a.lines, a.stmts, a.fns, a.branches) - Math.min(b.lines, b.stmts, b.fns, b.branches));
190
191
 
191
192
  console.log("\n" + chalk.bold("📉 WORST COVERAGE FILES (lines)"));
192
193
  console.log("-".repeat(80));
193
194
 
194
- fileRows.slice(0, worstCount).forEach(({ file, lines, stmts, fns, branches }) => {
195
+ const rowsToShow = fileRows.slice(0, worstCount);
196
+ rowsToShow.forEach(({ file, lines, stmts, fns, branches }) => {
195
197
  const extras = chalk.dim(`stmts ${stmts.toFixed(0)}% | fns ${fns.toFixed(0)}% | branches ${branches.toFixed(0)}%`);
196
198
  console.log(` ${colourPct(chalk, lines)}% ${chalk.dim(file)} ${extras}`);
197
199
  });