import { describe, expect, it } from "vitest"; import { chunkUnits, loadTypeScript, splitSourceUnits } from "./jev-find-source.ts"; describe("TS7 source parser", () => { it("keeps UTF-16 names and CRLF line positions", async () => { const parser = await loadTypeScript(); expect(parser).toBeDefined(); const text = '// 😀 header\r\nexport const café = "😀";\r\n\r\nexport function retry() { return café; }\r\n'; expect(splitSourceUnits("sample.ts", text, parser)).toEqual([ { name: "café", start: 1, end: 2 }, { name: "retry", start: 4, end: 4 }, ]); }); it("parses TSX from the supplied text without needing a physical file", async () => { const parser = await loadTypeScript(); const text = "export function View() { return