Add Aniimo elemental matchup calculator
This commit is contained in:
parent
72b3b15c7e
commit
243465720f
15 changed files with 518 additions and 10 deletions
|
|
@ -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/);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue