import { assert, describe, it } from "@effect/vitest"; import { Effect } from "effect"; import { RepoRef } from "../src/Repo.js"; describe("RepoRef.of", () => { it.effect("builds the coordinate positionally, slug derived", () => Effect.sync(() => { const ref = RepoRef.of("acme", "widget"); assert.instanceOf(ref, RepoRef); assert.strictEqual(ref.owner, "acme"); assert.strictEqual(ref.repo, "widget"); assert.strictEqual(ref.slug, "acme/widget"); assert.deepStrictEqual(ref, RepoRef.make({ owner: "acme", repo: "widget" })); }), ); it.effect("validates like make: an empty part throws", () => Effect.sync(() => { assert.throws(() => RepoRef.of("", "widget")); assert.throws(() => RepoRef.of("acme", "")); }), ); it.effect("make needs only owner and repo; slug is never a field", () => Effect.sync(() => { const ref = RepoRef.make({ owner: "acme", repo: "widget" }); assert.strictEqual(ref.slug, "acme/widget"); assert.isFalse(Object.keys(ref).includes("slug")); }), ); });