revision.test.ts
This file
Path
packages/artifacts/test/revision.test.ts
26 lines · 793 bytes · TypeScript
Last changed by
Merge build/comments-packages-rest into mainoscabrielbefore adoption38cd503
History of this fileTake it
123456789101112131415161718192021222324252627import { describe, expect, it } from "@effect/vitest";import * as Ids from "@repo/protocol/ids";import { Schema } from "effect";
import { BranchName, RepoName } from "../src/repo-host.ts";
describe("a repo name", () => { it("is the domain's RepoName", () => { expect(RepoName).toBe(Ids.RepoName); });});
// Artifacts' binding resolves short branch names and commit ids only,// so a full ref name cannot be a revision.describe("a branch revision", () => { it.each(["main", "feature/parser", "asked-landed"])("takes %s", (name) => { expect(Schema.is(BranchName)(name)).toBeTruthy(); });
it.each(["refs/heads/main", "refs/asked/landed", "refs/notes/commits", ""])( "refuses %j", (name) => { expect(Schema.is(BranchName)(name)).toBeFalsy(); } );});