Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

445 B
Raw Blame
// @vitest-environment node

import { getPostHogStatus } from "./usePostHogIntegration";

describe("getPostHogStatus", () => {
  it.each([
    [null, "inactive"],
    [{ enabled: true, lastError: null }, "active"],
    [{ enabled: false, lastError: null }, "inactive"],
    [{ enabled: false, lastError: "Invalid hostname" }, "error"],
  ])("maps %o to %s", (config, expected) => {
    expect(getPostHogStatus(config)).toBe(expected);
  });
});