Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.3 kB ยท 45 lines
TypeScript
12345678910111213141516171819202122232425262728293031323334353637383940414243444546import { expect } from "@std/expect";import { describe, test } from "@std/testing/bdd";
import { buildExternalPath } from "./build-external-path";
describe("buildExternalPath", () => { test("hostname routing: suffix stands alone", () => { expect( buildExternalPath({ type: "hostname", prefix: "acme" }, "/login"), ).toBe("/login"); });
test("hostname routing: empty suffix โ page root", () => { expect(buildExternalPath({ type: "hostname", prefix: "acme" }, "")).toBe( "", ); });
test("pathname routing: prefix prepended to suffix", () => { expect( buildExternalPath({ type: "pathname", prefix: "acme" }, "/login"), ).toBe("/acme/login"); });
test("pathname routing: empty suffix โ page root with prefix", () => { expect(buildExternalPath({ type: "pathname", prefix: "acme" }, "")).toBe( "/acme", ); });
test("pathname routing: /restricted suffix", () => { expect( buildExternalPath({ type: "pathname", prefix: "status" }, "/restricted"), ).toBe("/status/restricted"); });
test("hostname routing: custom-domain prefix", () => { expect( buildExternalPath( { type: "hostname", prefix: "status.acme.com" }, "/login", ), ).toBe("/login"); });});