mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 23:12:06 -03:30
24 lines
786 B
TypeScript
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/");
|
|
});
|
|
});
|