my-kaiqiuwang/__test__/utils.load-html.test.ts
kyuuseiryuu b7d2109f2e refactor(utils): split shared helpers and server scraping modules
- move event scraping/parsing and match lookup logic into src/utils/server.ts
- extract BASE_URL and grouping/round-table helpers into src/utils/common.ts
- update component/service entry imports to new module locations
- remove deprecated src/utils/utils.ts monolith
- clean up unused XCXFindUser type import
- update tests to new utils import path
2026-02-26 00:26:25 +09:00

18 lines
632 B
TypeScript

import { expect, test } from 'bun:test';
import path from 'path';
import fs from 'fs';
import { fetchEventContentHTML, fetchEventListHTML } from '../src/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);
});