my-kaiqiuwang/__test__/utils.load-html.test.ts
kyuuseiryuu 79c839db00 feat: add current-score grouping flow with cached uid score API
- move shared parsing/grouping helpers into serverUtils and update imports
- add xcxApi singleton in serverUtils
- add Redis-backed uid score store and /api/user/nowScores endpoint
- preload uid scores in event loader and tags in profile loader
- allow grouping prediction to switch sort mode between current/yearly score
- update tags component to consume loader-provided tags
- remove unused zustand game store
- add redis test scaffold and scoreboard component scaffold
2026-02-26 00:13:37 +09:00

18 lines
637 B
TypeScript

import { expect, test } from 'bun:test';
import path from 'path';
import fs from 'fs';
import { fetchEventContentHTML, fetchEventListHTML } from '../src/utils/utils';
test('load html', async () => {
const saveTo = path.resolve(__dirname, 'data', 'view-event.html');
const html = await fetchEventListHTML(`47`);
fs.writeFileSync(saveTo, html?? '');
expect(html?.length).not.toBe(0);
});
test('load html', async () => {
const saveTo = path.resolve(__dirname, 'data', 'view-event-content.html');
const html = await fetchEventContentHTML('167684');
fs.writeFileSync(saveTo, html?? '');
expect(html?.length).not.toBe(0);
});