chore: initialize qiming workspace repository

This commit is contained in:
Codex
2026-05-29 14:22:48 +08:00
commit bfd67a0f2c
10750 changed files with 1885711 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import {
uploadAttachmentFile,
} from "../../src/utils/project/uploadAttachmentFileUtils.js";
import {
ValidationError,
} from "../../src/utils/error/errorHandler.js";
describe("uploadAttachmentFileUtils", () => {
describe("参数验证测试", () => {
test("项目ID为空应该抛出 ValidationError", async () => {
const mockFile = {
originalname: "test.txt",
path: "/tmp/test.txt",
size: 4,
};
await expect(uploadAttachmentFile("", mockFile)).rejects.toThrow(ValidationError);
});
test("文件对象为空应该抛出 ValidationError", async () => {
await expect(uploadAttachmentFile("test-project", null)).rejects.toThrow(ValidationError);
});
test("文件路径为空应该抛出 ValidationError", async () => {
const mockFile = {
originalname: "test.txt",
path: "",
size: 4,
};
await expect(uploadAttachmentFile("test-project", mockFile)).rejects.toThrow(ValidationError);
});
});
});