refactor : forget this file

This commit is contained in:
2026-08-15 23:08:14 +07:00 Unverified
parent 284c77d658
commit cbe4928a05
-30
View File
@@ -1,30 +0,0 @@
import { describe, expect, test } from "bun:test";
import { validateImageUploadFile } from "../cdn-images";
const png = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);
describe("image upload validation", () => {
test("accepts a valid PNG signature", () => {
expect(() =>
validateImageUploadFile(
{ name: "avatar.png", type: "image/png", size: png.length },
png
)
).not.toThrow();
});
test("rejects content that does not match the declared type", () => {
expect(() =>
validateImageUploadFile(
{ name: "avatar.png", type: "image/png", size: 4 },
new Uint8Array([1, 2, 3, 4])
)
).toThrow("contents do not match");
});
test("rejects empty files", () => {
expect(() =>
validateImageUploadFile({ name: "avatar.png", type: "image/png", size: 0 })
).toThrow("cannot be empty");
});
});