test: 整併測試至 app/test 並解決 AI 審查 findings #8

Closed
jiantw83 wants to merge 23 commits from test/consolidate-app-test-20260626-111823 into develop
Showing only changes of commit 5e8d58b5f9 - Show all commits
+15
View File
1
@@ -104,6 +104,21 @@ test('loadConfig 於 GITEA_REPOSITORY 邊界格式(空段/缺斜線/多段)
}
});
test('loadConfig 於 GITEA_REPOSITORY 含非法字元或超長段時拋錯', () => {
const bad = [
'ow ner/repo',
'owner/re*po',
'owner/re:po',
`${'a'.repeat(101)}/repo`,
];
for (const repo of bad) {
assert.throws(() => loadConfig({
GITEA_SERVER_URL: 'https://gitea.example.com',
GITEA_REPOSITORY: repo,
}), /GITEA_REPOSITORY 格式錯誤/, `應拒絕:${repo}`);
}
});
test('loadConfig 接受含點號的合法 owner/repo', () => {
const config = loadConfig({
GITEA_SERVER_URL: 'https://gitea.example.com',