Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

868 B
Raw Blame
import { test } from "node:test";
import assert from "node:assert/strict";
import { NOAUTH_PROVIDERS, providerAllowsOptionalApiKey } from "@/shared/constants/providers";

test("uncloseai should be treated as a no-auth provider", () => {
  const isNoAuthRegistered = Object.prototype.hasOwnProperty.call(NOAUTH_PROVIDERS, "uncloseai");
  const allowsOptionalKey = providerAllowsOptionalApiKey("uncloseai");

  assert.equal(
    isNoAuthRegistered || allowsOptionalKey,
    true,
    "uncloseai must be registered in NOAUTH_PROVIDERS or allow an optional API key " +
      "so the dashboard doesn't force users to enter a key for a no-auth provider"
  );
  assert.equal(
    isNoAuthRegistered,
    true,
    "uncloseai must be registered in NOAUTH_PROVIDERS (not just allow an optional key) " +
      "so the dashboard renders the NoAuthProviderControls flow"
  );
});