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.

21 linesCodeBlameRaw
1import assert from "node:assert/strict";
2import { test } from "node:test";
3import { projectCheckSections } from "./project-checks.ts";
4
5test("a CLI-only fix keeps latest branch checks separate from the older production commit", () => {
6 assert.deepEqual(projectCheckSections("6049e67", "main", "a8f62b9"), [
7 { kind: "branch", label: "Latest on main", sha: "6049e67" },
8 { kind: "production", label: "Checks for deployed commit", sha: "a8f62b9" },
9 ]);
10});
11
12test("the same commit is not reported twice, and a project without deployment still shows branch checks", () => {
13 const branch = [{ kind: "branch", label: "Latest on trunk", sha: "head" }];
14 assert.deepEqual(projectCheckSections("head", "trunk", "head"), branch);
15 assert.deepEqual(projectCheckSections("head", "trunk", null), branch);
16});
17
18test("an unavailable branch head never mislabels deployed checks as latest branch checks", () => {
19 assert.deepEqual(projectCheckSections(null, "main", "old"), [{ kind: "production", label: "Checks for deployed commit", sha: "old" }]);
20 assert.deepEqual(projectCheckSections(null, null, null), []);
21});