test: deepen integration tests for 11 medium tools (HEIC, large file, batch, edge cases)

This commit is contained in:
SnapOtter
2026-05-01 02:48:35 +08:00
parent 710b580cee
commit b663a1fbab
11 changed files with 549 additions and 0 deletions
+43
View File
@@ -452,3 +452,46 @@ describe("HEIC with different methods", () => {
expect(res.statusCode).toBe(200);
});
});
// ── HEIF input ──────────────────────────────────────────────────
describe("HEIF input", () => {
it("processes HEIF image (motorcycle.heif)", async () => {
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
const res = await postTool(
{ method: "adaptive", sigma: 2.0 },
HEIF,
"photo.heif",
"image/heif",
);
expect(res.statusCode).toBe(200);
const result = JSON.parse(res.body);
expect(result.downloadUrl).toBeDefined();
}, 60_000);
});
// ── Animated GIF input ──────────────────────────────────────────
describe("Animated GIF input", () => {
it("processes animated GIF", async () => {
const GIF = readFileSync(join(FIXTURES, "animated.gif"));
const res = await postTool(
{ method: "unsharp-mask", amount: 150 },
GIF,
"anim.gif",
"image/gif",
);
expect(res.statusCode).toBe(200);
const result = JSON.parse(res.body);
expect(result.downloadUrl).toBeDefined();
});
});
// ── SVG input ───────────────────────────────────────────────────
describe("SVG input", () => {
it("processes SVG image", async () => {
const SVG = readFileSync(join(FIXTURES, "test-100x100.svg"));
const res = await postTool({ method: "adaptive" }, SVG, "icon.svg", "image/svg+xml");
expect(res.statusCode).toBe(200);
const result = JSON.parse(res.body);
expect(result.downloadUrl).toBeDefined();
});
});