LINE/Test: tighten temp path type guard (openclaw#20792) thanks @mbelinky

This commit is contained in:
mbelinky
2026-02-19 10:34:04 +01:00
parent 8bfb9d99c3
commit f6f3eecdb3

View File

@@ -45,6 +45,9 @@ describe("downloadLineMedia", () => {
expect(result.size).toBe(jpeg.length);
expect(result.contentType).toBe("image/jpeg");
expect(typeof writtenPath).toBe("string");
if (typeof writtenPath !== "string") {
throw new Error("expected string temp file path");
}
expect(result.path).toBe(writtenPath);
expect(writtenPath).toContain("line-media-");
expect(writtenPath).toMatch(/\.jpg$/);