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.

24 linesCodeBlameRaw
1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { confirmsPurge, daysLeft, wentSummary } from "./deleted-workspaces.ts";
5
6test("what went reads as one line", () => {
7 assert.equal(wentSummary({ repositories: 3, projects: 1, members: 2, billing: null, protected: false }), "3 repositories, 1 project, 2 members");
8 assert.equal(wentSummary({ repositories: 1, projects: 0, members: 1, billing: null, protected: false }), "1 repository, 0 projects, 1 member");
9});
10
11test("days left round up, and none once it is due", () => {
12 const now = Date.parse("2026-10-06T12:00:00Z");
13 assert.equal(daysLeft("2026-11-05T12:00:00Z", now), 30);
14 assert.equal(daysLeft("2026-10-06T13:00:00Z", now), 1);
15 assert.equal(daysLeft("2026-10-06T12:00:00Z", now), 0);
16 assert.equal(daysLeft("2026-10-01T00:00:00Z", now), 0);
17 assert.equal(daysLeft("not a date", now), 0);
18});
19
20test("a purge is confirmed by the slug alone", () => {
21 assert.ok(confirmsPurge("acme", " Acme "));
22 assert.ok(!confirmsPurge("acme", ""));
23 assert.ok(!confirmsPurge("acme", "acme-inc"));
24});