refactor(release-cleanup): 將清理邏輯由 bash 改寫為 Node.js #6

Closed
jiantw83 wants to merge 60 commits from refactor/nodejs-rewrite-20260626-103443 into develop
Showing only changes of commit 50b626cf87 - Show all commits
+12
View File
@@ -30,6 +30,18 @@ test('categorizeTags 將無名稱的 tag 標記為略過', () => {
assert.equal(empty.action, 'skip')
})
test('categorizeTags 對 null/非字串 name 的項目標記為略過(不拋例外)', () => {
const odd = [null, { name: 123 }, {}, { name: 'v1' }]
let result
assert.doesNotThrow(() => {
result = categorizeTags(odd, ['v1'])
})
assert.deepEqual(
result.map((r) => r.action),
['skip', 'skip', 'skip', 'keep'],
)
})
test('categorizeTags 在沒有任何 release 指定時刪除所有具名 tag', () => {
const result = categorizeTags(tags, [])
const deletes = result.filter(({ action }) => action === 'delete')