g1t/apps/web/app/lib/registry-paths.test.ts

28 lines971 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { servicePath } from "./registry-paths.ts";
5
6test("the container registry's paths go to the packages service", () => {
7 for (const path of [
8 "/v2",
9 "/v2/",
10 "/v2/token",
11 "/v2/acme/web/manifests/latest",
12 "/v2/acme/web/api/blobs/uploads/upl_1",
13 "/v2/acme/web/tags/list",
14 "/v2/acme/web/referrers/sha256:abc",
15 ]) {
16 assert.equal(servicePath(path), "packages", path);
17 }
18});
19
20test("git goes to repos, and everything else is the site's", () => {
21 assert.equal(servicePath("/acme/web.git/info/refs"), "git");
22 assert.equal(servicePath("/acme/web/git-receive-pack"), "git");
23 // A registry image named like a git endpoint is still the registry's.
24 assert.equal(servicePath("/v2/acme/info/refs"), "packages");
25 for (const path of ["/", "/acme", "/acme/web", "/v2x", "/acme/v2", "/acme/-/packages"]) {
26 assert.equal(servicePath(path), null, path);
27 }
28});