Cap face analysis at what one Node thread can commit, prefer IPv4 so a dead IPv6 route cannot fail the fetch, and leave a photo on the desk when ZeroZero says it is already there. Desktop originals go out one at a time so the app does not freeze on "A enviar…".
17 lines
746 B
TypeScript
17 lines
746 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { fetchFailure } from "../src/delivery/zerozero.js";
|
|
|
|
describe("zerozero fetch errors", () => {
|
|
it("keeps the socket code that fetch hides on cause", () => {
|
|
const err = new TypeError("fetch failed");
|
|
(err as { cause?: unknown }).cause = { code: "ETIMEDOUT", message: "connect ETIMEDOUT" };
|
|
expect(fetchFailure(err)).toBe("fetch failed (ETIMEDOUT)");
|
|
});
|
|
|
|
it("joins every address error when happy eyeballs fails them all", () => {
|
|
const err = new TypeError("fetch failed");
|
|
(err as { cause?: unknown }).cause = { errors: [{ code: "ENETUNREACH" }, { code: "ECONNREFUSED" }] };
|
|
expect(fetchFailure(err)).toBe("fetch failed (ENETUNREACH, ECONNREFUSED)");
|
|
});
|
|
});
|