Versions 175 to 318
new file, 222 lines
1+// Local projects (abso init --local): a project whose history is in a store on this machine, answered by the open
2+// server's own code in the client's process. Every test here runs with fetch replaced by one that throws, so any
4+
7+import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
15+
22+
36+
38+const env = () => ({ ABSO_STORE: store, ABSO_SERVERS_FILE: "no-servers.json", ABSO_HOOK_FORCE: "1" });
39+async function run(cwd: string, ...argv: string[]): Promise<{ exit: number; out: string; err: string }> {
44+
45+/** A copy of the client without the open server beside it (a platform that pins only client/) has no local projects to test. */
46+const noServer = existsSync(fileURLToPath(new URL("../../server/src/router.ts", import.meta.url)))
49+
56+
62+ assert.match(r.out, /Created project demo at version 0 from 2 text files/, "a.txt and the starting .absoignore");
69+ assert.equal(config.store, undefined, "the store came from ABSO_STORE, so the folder doesn't name it");
71+
83+
96+
103+
113+
136+
140+ const answers = await Promise.all([local(`${LOCAL_BASE}/p/demo/queue`), local(`${LOCAL_BASE}/p/demo/queue`)]);
144+
145+ it("a project's name can't start with a dot, so its folder stays inside the store", async () => {
158+
160+ it("--store inside the folder is kept in its settings and left out of its files", async () => {
164+ const r = await run(dir, "init", "--local", "--project", "beside", "--agent", "a", "--store", ".abso-store");
167+ assert.equal(JSON.parse(readFileSync(join(stateDir(dir), "config.json"), "utf8")).store, join(dir, ".abso-store"));
174+
178+ const both = await run(dir, "init", "--local", "--server", "https://abso.test", "--project", "p");
183+
193+
195+ // The way people and agents run them: client/abso.ts, a process per command, Node's compile cache as it is.
203+
217+ assert.equal(r.status, 0, `${name}: exit ${r.status} ${r.signal ?? ""}\n${r.stdout}${r.stderr}`);
- MCP
- compare on this site's /mcp
- CLI
- abso diff 175 318 client/test/local.test.ts --json
- JSON
- /christopher/abso-core/compare/175..318?file=client%2Ftest%2Flocal.test.ts&format=json