Add local automatic backups and Aniimo regions lists
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
This commit is contained in:
parent
2255de94a7
commit
0a3bb4dffd
24 changed files with 908 additions and 16 deletions
|
|
@ -112,7 +112,9 @@ test("grouping preserves order and contains only variants that pass all filters"
|
|||
test("loader passes cancellation to all requests and reports failed responses", async (context) => {
|
||||
const calls = [];
|
||||
const controller = new AbortController();
|
||||
const bodies = [aniimos, fr, en];
|
||||
const listIndex = await readJson("aniimo/lists/index.json");
|
||||
const regions = await readJson("aniimo/lists/regions.json");
|
||||
const bodies = [aniimos, fr, en, listIndex, regions];
|
||||
context.mock.method(globalThis, "fetch", async (url, options) => {
|
||||
calls.push({ url, options });
|
||||
const body = bodies[calls.length - 1];
|
||||
|
|
@ -120,7 +122,10 @@ test("loader passes cancellation to all requests and reports failed responses",
|
|||
});
|
||||
const result = await loadAniimoData(controller.signal);
|
||||
assert.equal(result.variants.length, data.variants.length);
|
||||
assert.equal(calls.length, 3);
|
||||
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.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