Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

44 linesCodeBlameRaw
1import assert from "node:assert/strict";
2import { readFileSync, existsSync } from "node:fs";
3import { test } from "node:test";
4import { FEATURES } from "../apps/web/app/lib/features.ts";
5
6const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), "utf8").replaceAll("\r\n", "\n");
7
8test("llms.txt follows the heading and file-list format and preserves the detailed guide", () => {
9 const index = read("apps/web/public/llms.txt");
10 assert.match(index, /^# g1t\n\n> /);
11 for (const section of index.split(/^## .+$/m).slice(1)) {
12 const lines = section.trim().split("\n").filter(Boolean);
13 assert.ok(lines.length > 0);
14 for (const line of lines) assert.match(line, /^- \[[^\]]+\]\(https:\/\/[^)]+\)(: .+)?$/);
15 }
16 for (const url of ["/features", "/developers", "/agents.md", "/openapi.json", "/reference/versioning.md", "/settings/tokens"]) assert.ok(index.includes(url), url);
17 assert.match(read("apps/web/public/agents.md"), /## Set someone up/);
18});
19
20test("features is routed, discoverable on desktop and mobile, and has real documentation targets", () => {
21 assert.match(read("apps/web/app/routes.ts"), /route\("features", "routes\/features.tsx"\)/);
22 assert.match(read("apps/web/app/routes/sitemap-xml.ts"), /"\/features"/);
23 const header = read("apps/web/app/components/public-header.tsx");
24 assert.match(header, /<HeaderLink to="\/features">Features<\/HeaderLink>/);
25 assert.match(header, /<Link to="\/features">/);
26 assert.equal(new Set(FEATURES.map((f) => f.id)).size, FEATURES.length);
27 for (const feature of FEATURES) for (const link of feature.links) {
28 if (!link.href.startsWith("https://docs.g1t.sh/")) continue;
29 const slug = new URL(link.href).pathname.replace(/\/$/, "");
30 assert.ok(["md", "mdx"].some((ext) => existsSync(new URL(`../apps/docs/src/content/docs${slug}.${ext}`, import.meta.url))), link.href);
31 }
32});
33
34test("built developer pages have branded headings, canonical URLs and Markdown counterparts", () => {
35 for (const slug of ["reference/developers", "reference/versioning", "reference/api", "reference/mcp", "guides/authentication"]) {
36 const html = read(`apps/docs/dist/${slug}/index.html`);
37 assert.match(html, /<title>g1t /);
38 assert.match(html, /<h1[^>]*[^]*?>g1t /);
39 assert.ok(html.includes(`https://docs.g1t.sh/${slug}/`));
40 assert.match(read(`apps/docs/dist/${slug}.md`), /^# g1t /);
41 }
42 const policy = read("apps/docs/dist/reference/versioning.md");
43 for (const text of ["X-G1t-Api-Version", "Deprecation", "Sunset", 'rel="deprecation"', "No REST version is currently deprecated"]) assert.ok(policy.includes(text), text);
44});