Ricardo Martin 93812a6e14
Enable unit tests for keycloak-admin-client
Closes #44268

Signed-off-by: rmartinc <rmartinc@redhat.com>
2025-12-08 18:14:13 +01:00

24 lines
786 B
TypeScript

import { expect } from "chai";
import { joinPath } from "../src/utils/joinPath.ts";
describe("joinPath", () => {
it("returns an empty string when no paths are provided", () => {
expect(joinPath()).to.equal("");
});
it("joins paths", () => {
expect(joinPath("foo", "bar", "baz")).to.equal("foo/bar/baz");
expect(joinPath("foo", "/bar", "baz")).to.equal("foo/bar/baz");
expect(joinPath("foo", "bar/", "baz")).to.equal("foo/bar/baz");
expect(joinPath("foo", "/bar/", "baz")).to.equal("foo/bar/baz");
});
it("joins paths with leading slashes", () => {
expect(joinPath("/foo", "bar", "baz")).to.equal("/foo/bar/baz");
});
it("joins paths with trailing slashes", () => {
expect(joinPath("foo", "bar", "baz/")).to.equal("foo/bar/baz/");
});
});