gitlab_monitor/test/service/discussion.test.ts
zhaoyingbo 92fa30ef3d
All checks were successful
CI Monitor MIflow / build-image (push) Successful in 2m42s
feat: 支持初步的CR
2024-08-12 12:24:45 +00:00

44 lines
1.0 KiB
TypeScript

import { test } from "bun:test"
import service from "../../service"
// 测试用例
test("Gitlab Discussion", async () => {
const project_id = 139032
const merge_request_iid = 488
const res = await service.gitlab.discussions.getList(
project_id,
merge_request_iid
)
console.log(res)
const body = "LGTM!"
const position: any = {
base_sha: "17a35cfb47b46e85f507c5f602907ffc429d40c0",
start_sha: "2d6f9d6d5cbfd323e06e37859ee9b19c3578619c",
head_sha: "710458e37476915e585d480961786e7eedbc79fb",
old_path: "src/pages/AIWorkbench/controller/index.ts",
new_path: "src/pages/AIWorkbench/controller/index.ts",
position_type: "text",
new_line: 21,
line_range: {
start: {
line_code: "6988b6e297ca054b9ffaa69f4a0f4a954e749f78_0_21",
},
end: {
line_code: "6988b6e297ca054b9ffaa69f4a0f4a954e749f78_0_25",
},
},
}
const res2 = await service.gitlab.discussions.create2Mr(
project_id,
merge_request_iid,
body,
position
)
console.log(res2)
}, 10000)