test: simplify nodes media path collection · openclaw/openclaw@5377e95
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -113,11 +113,16 @@ describe("cli program (nodes media)", () => {
|
113 | 113 | expect(facings).toEqual(["back", "front"]); |
114 | 114 | |
115 | 115 | const out = getFirstRuntimeLogLine(); |
116 | | -const mediaPaths = out |
117 | | -.split("\n") |
118 | | -.filter((l) => l.startsWith("MEDIA:")) |
119 | | -.map((l) => l.replace(/^MEDIA:/, "")) |
120 | | -.filter(Boolean); |
| 116 | +const mediaPaths: string[] = []; |
| 117 | +for (const line of out.split("\n")) { |
| 118 | +if (!line.startsWith("MEDIA:")) { |
| 119 | +continue; |
| 120 | +} |
| 121 | +const mediaPath = line.replace(/^MEDIA:/, ""); |
| 122 | +if (mediaPath.length > 0) { |
| 123 | +mediaPaths.push(mediaPath); |
| 124 | +} |
| 125 | +} |
121 | 126 | expect(mediaPaths).toHaveLength(2); |
122 | 127 | expect(mediaPaths[0]).toContain("openclaw-camera-snap-"); |
123 | 128 | expect(mediaPaths[1]).toContain("openclaw-camera-snap-"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。