Open source alternative to Semrush and Ahrefs
TypeScript backlink-analysisgoogle-search-console-mcpkeyword-researchmcpseoseo-agentseo-auditseo-automationseo-skillsseo-toolssite-audit
import { describe, expect, it } from "vitest";
import { getStandardErrorMessage } from "@/client/lib/error-messages";
describe("getStandardErrorMessage", () => {
it("maps known error codes to standard copy", () => {
expect(getStandardErrorMessage(new Error("PAYMENT_REQUIRED"))).toBe(
"An active hosted subscription is required before you can use OpenSEO.",
);
});
it("returns custom messages when the error is not a shared code", () => {
expect(
getStandardErrorMessage(new Error("Something failed: try again")),
).toBe("Something failed: try again");
});
});