fix(ai-review): 對齊建問題模式留言順序與命名

This commit is contained in:
Jeffery
2026-07-21 14:39:42 +08:00
parent 941d763129
commit 9d05af647b
9 changed files with 64 additions and 85 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ const test = require('node:test');
const gitea = require('../src/lib/gitea');
function withFetchStub(handler, fn) {
function withFetchStub(handler, callback) {
const originalFetch = global.fetch;
const calls = [];
global.fetch = async (url, options = {}) => {
@@ -13,7 +13,7 @@ function withFetchStub(handler, fn) {
return handler(url, options);
};
return Promise.resolve()
.then(() => fn(calls))
.then(() => callback(calls))
.finally(() => {
global.fetch = originalFetch;
});
+2 -2
View File
@@ -44,7 +44,7 @@ test('agentFailureDetail 在 debug 模式輸出遮罩後片段', () => {
}
});
test('postOthersToIssue 批次送出 issue 留言', async () => {
test('postOthersToIssue 依序送出 issue 留言以維持排序', async () => {
const calls = [];
let active = 0;
let maxActive = 0;
@@ -71,7 +71,7 @@ test('postOthersToIssue 批次送出 issue 留言', async () => {
assert.equal(calls.length, 2);
assert.equal(calls[0].issueNumber, 7);
assert.ok(maxActive > 1);
assert.equal(maxActive, 1);
});
test('resultFilesToCommit 在建問題模式有嚴重問題時仍提交 findings', () => {