- 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
18 lines
632 B
TypeScript
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);
|
|
}); |