Diffinery

homeflare/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

diffinery/apps/diffinery/test/unit/unpack-failure.test.ts
13 lines · 754 BRaw History
1import { describe, expect, it } from "vitest";
2import { unpackFailure } from "../../src/git/protocol.js";
3
4describe("unpack failures", () => {
5 it("say to split a push that ran out of memory, so clients and the importer push smaller chunks", () => {
6 expect(unpackFailure(new RangeError("Array buffer allocation failed"))).toBe("the push needs more memory than one push may use; split it into smaller pushes (Array buffer allocation failed)");
7 expect(unpackFailure(new Error("Out of memory"))).toMatch(/split it into smaller pushes/);
8 });
9 it("pass other errors through as they are", () => {
10 expect(unpackFailure(new Error("pack checksum mismatch"))).toBe("pack checksum mismatch");
11 expect(unpackFailure("odd")).toBe("odd");
12 });
13});