mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-04 13:48:57 +00:00
fix(ci): атомарно печатать отчёт private-writes (#645)
Linux CI при параллельном npm test мог потерять последнюю отдельную запись stdout после длинной таблицы --count. Формируем отчёт целиком и пишем его одним вызовом, чтобы итоговая строка всегда доходила до unit-теста. Issue: #645 User-Visible: no
This commit is contained in:
@@ -289,10 +289,11 @@ function main(argv) {
|
||||
const byFile = countWrites(ROOT);
|
||||
const writes = byFile.reduce((sum, f) => sum + f.writes, 0);
|
||||
const calls = byFile.reduce((sum, f) => sum + f.calls, 0);
|
||||
for (const f of byFile.sort((a, b) => b.writes - a.writes || a.path.localeCompare(b.path))) {
|
||||
console.log(`${String(f.writes).padStart(5)} ${String(f.calls).padStart(5)} ${f.path}`);
|
||||
}
|
||||
console.log(`Итого: записей ${writes}, покрытых фасадом вызовов ${calls} в ${byFile.length} файл(ах).`);
|
||||
const lines = byFile
|
||||
.sort((a, b) => b.writes - a.writes || a.path.localeCompare(b.path))
|
||||
.map((f) => `${String(f.writes).padStart(5)} ${String(f.calls).padStart(5)} ${f.path}`);
|
||||
lines.push(`Итого: записей ${writes}, покрытых фасадом вызовов ${calls} в ${byFile.length} файл(ах).`);
|
||||
process.stdout.write(`${lines.join('\n')}\n`);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user