import assert from "node:assert/strict"; import { readFile } from "node:fs/promises"; import test from "node:test"; const homePageSource = await readFile( new URL("../src/pages/HomePage.tsx", import.meta.url), "utf8", ); test("shares the four history columns between records and the loading state", () => { const columns = sourceForFunction("HistoryTableColumns"); const skeleton = sourceForFunction("HistoryRecordsSkeleton"); const records = sourceForFunction("HistoryRecords"); assert.equal(columns.match(/)/g)?.length, 4); assert.deepEqual( Array.from(columns.matchAll(/]*>\s*([^<]+?)\s*<\/th>/g), (match) => match[1]), ["일정", "대회", "상태·결과", "참가"], ); assert.match(skeleton, //); assert.match(records, //); assert.doesNotMatch(skeleton, /