release: dsh-infstarapi 0.2.0
CI / test (push) Canceled after 0s

This commit is contained in:
Coldsmile_7 committed 2026-11-26 08:24:56 +08:00
1 parent a8f689e39c
commit c340aec110
59 files changed
+1108 -1590

No files matched your search

+3 -4
View File
@@ -33,9 +33,8 @@ test('normalizes host lists, keeping order and falling back to the defaults', ()
assert.deepEqual(normalizeHostList(undefined), [...DEFAULT_API_HOSTS])
})
test('the defaults are Geek2API entry points only', () => {
assert.ok(DEFAULT_API_HOSTS.length >= 2)
for (const host of DEFAULT_API_HOSTS) assert.match(host, /^https:\/\/[a-z0-9]+\.geek2api\.com$/u)
test('the default is the InfStarAPI gateway origin', () => {
assert.deepEqual(DEFAULT_API_HOSTS, ['https://sub.infstar.org'])
})
test('only failures that never reached the host count as transport failures', () => {
@@ -133,7 +132,7 @@ test('withFailover moves on only after transport failures', async () => {
}), /rejected \(401\)/u)
assert.equal(refused.length, 1)
await assert.rejects(pool.withFailover(async () => { throw transport() }), /no Geek2API host answered/u)
await assert.rejects(pool.withFailover(async () => { throw transport() }), /no InfStarAPI host answered/u)
})
test('withFailover honours cancellation', async () => {