Add Aniimo elemental matchup calculator
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 18m14s
Validate and deploy Sokko G / deploy (push) Successful in 10s

This commit is contained in:
Shinuwa 2026-10-31 09:43:04 +01:00
parent 72b3b15c7e
commit 243465720f
15 changed files with 518 additions and 10 deletions

View file

@ -172,7 +172,8 @@ test("loader passes cancellation to all requests and reports failed responses",
const controller = new AbortController();
const listIndex = await readJson("aniimo/lists/index.json");
const regions = await readJson("aniimo/lists/regions.json");
const bodies = [aniimos, fr, en, listIndex, regions];
const elementChart = await readJson("aniimo/elements.json");
const bodies = [aniimos, fr, en, listIndex, elementChart, regions];
context.mock.method(globalThis, "fetch", async (url, options) => {
calls.push({ url, options });
const body = bodies[calls.length - 1];
@ -183,7 +184,8 @@ test("loader passes cancellation to all requests and reports failed responses",
assert.equal(result.lists.length, 1);
assert.equal(result.lists[0].id, "regions");
assert.equal(result.lists[0].itemCount, 14);
assert.equal(calls.length, 5);
assert.deepEqual(result.elementChart, elementChart);
assert.equal(calls.length, 6);
assert.ok(calls.every((call) => call.options.signal === controller.signal));
globalThis.fetch.mock.mockImplementation(async () => ({ ok: false }));
await assert.rejects(loadAniimoData(controller.signal), /indisponibles/);