test: simplify cron run log line collection · openclaw/openclaw@6e9ed3e
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -87,10 +87,13 @@ describe("cron run log", () => {
|
87 | 87 | } |
88 | 88 | |
89 | 89 | const raw = await fs.readFile(logPath, "utf-8"); |
90 | | -const lines = raw |
91 | | -.split("\n") |
92 | | -.map((l) => l.trim()) |
93 | | -.filter(Boolean); |
| 90 | +const lines: string[] = []; |
| 91 | +for (const rawLine of raw.split("\n")) { |
| 92 | +const line = rawLine.trim(); |
| 93 | +if (line) { |
| 94 | +lines.push(line); |
| 95 | +} |
| 96 | +} |
94 | 97 | expect(lines.length).toBe(3); |
95 | 98 | const last = JSON.parse(lines[2] ?? "{}") as { ts?: number }; |
96 | 99 | expect(last.ts).toBe(1009); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。