// Covers kepr.js's start: every island it calls is defined, so one missing name can't stop the // rest of the page's scripts. import { expect, test } from "bun:test"; const script = await Bun.file(new URL("../public/js/kepr.js", import.meta.url)).text(); test("every function kepr.js calls at start is defined in it", () => { const started = [...script.matchAll(/^(\w+)\(/gm)].map((match) => match[1] as string); expect(started.length).toBeGreaterThan(5); for (const name of started) { expect(`${name} ${new RegExp(`^(async )?function ${name}\\(`, "m").test(script)}`).toBe( `${name} true`, ); } });