Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

635 B
Raw Blame
import { describe, expect, it } from "vite-plus/test";
import { storageFailureStatus } from "./probe-storage";

describe("storageFailureStatus", () => {
  it("warns when the bucket refuses to be listed", () => {
    expect(storageFailureStatus({ $metadata: { httpStatusCode: 403 } })).toBe(
      "warning",
    );
  });

  it("is down for a missing bucket or an unreachable endpoint", () => {
    expect(storageFailureStatus({ $metadata: { httpStatusCode: 404 } })).toBe(
      "down",
    );
    expect(
      storageFailureStatus(
        Object.assign(new Error(), { code: "ECONNREFUSED" }),
      ),
    ).toBe("down");
  });
});