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.

g1t.sh
31 linesCodeBlameRaw

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.

Deploy ends with a smoke test: sign-in, sign-up and the waitlist still work on g1t.sh1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { CHECKS, pageText, verdict } from "./smoke.mjs";
5
6test("a page's text leaves out scripts, styles and tags", () => {
Merge branch 'open-signups'7 const html = `<html><style>.a{}</style><script>var x="Create account"</script><h1>Create your&nbsp;<b>account</b></h1></html>`;
8 assert.equal(pageText(html), "Create your account");
Deploy ends with a smoke test: sign-in, sign-up and the waitlist still work on g1t.sh9 assert.equal(pageText("<p>Don&#x27;t</p>"), "Don't");
10});
11
12test("a check passes on its status with every phrase on the page", () => {
Merge branch 'open-signups'13 const check = { path: "/register", expect: ["Create your account", "Create account"] };
14 assert.equal(verdict(check, 200, "<h1>Create your account</h1><button>Create account</button>"), null);
Deploy ends with a smoke test: sign-in, sign-up and the waitlist still work on g1t.sh15 assert.equal(verdict(check, 500, ""), "answered 500, expected 200");
Merge branch 'open-signups'16 assert.equal(verdict(check, 200, "<h1>Create your account</h1>"), 'missing "Create account"');
Deploy ends with a smoke test: sign-in, sign-up and the waitlist still work on g1t.sh17});
18
19test("a phrase only inside a script does not count", () => {
Merge branch 'open-signups'20 const check = { path: "/", expect: ["Create account"] };
21 assert.equal(verdict(check, 200, `<script>"Create account"</script>`), 'missing "Create account"');
Deploy ends with a smoke test: sign-in, sign-up and the waitlist still work on g1t.sh22});
23
Merge branch 'open-signups'24test("the sign-up check sends an address identity refuses before writing or counting", () => {
25 const signUp = CHECKS.find((check) => check.form);
26 assert.ok(signUp);
27 assert.equal(signUp.path, "/register");
28 assert.ok(!signUp.form.email.includes("@"), "never a real-looking address, so nothing is kept");
29 assert.equal(signUp.status, 422);
30 assert.equal(verdict(signUp, 422, "<p>Enter a valid email address.</p>"), null);
Deploy ends with a smoke test: sign-in, sign-up and the waitlist still work on g1t.sh31});

This file's history is long; its oldest lines are credited to the oldest commit read.