import { Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; import * as ts from "../src/components/index.js"; import { Reference } from "../src/components/Reference.js"; it("using refkey that is missing declration show info about it", () => { const key = refkey("foo"); expect( {key} , // cspell:ignore sfoo ).toRenderTo(``); }); it("works with back references", () => { expect( const foo = 1; const v = ; , ).toRenderTo({ "test1.ts": ` const foo = 1; `, "test2.ts": ` import { foo } from "./test1.js"; const v = foo; `, }); }); it("works with forward references", () => { expect( const v = ; const foo = 1; , ).toRenderTo({ "test1.ts": ` const foo = 1; `, "test2.ts": ` import { foo } from "./test1.js"; const v = foo; `, }); });