refactor: move mergePaths() to utils.ts (#2905)

This commit is contained in:
Tim Reichen
2025-05-12 09:59:37 +02:00
committed by GitHub
parent c6d4c47e00
commit 9605cd81b5
5 changed files with 33 additions and 32 deletions
+11
View File
@@ -0,0 +1,11 @@
import { expect } from "@std/expect";
import { mergePaths } from "./utils.ts";
Deno.test("mergePaths", () => {
expect(mergePaths("", "")).toEqual("");
expect(mergePaths("/", "/foo")).toEqual("/foo");
expect(mergePaths("/*", "/foo")).toEqual("/foo");
expect(mergePaths("/foo/bar", "/baz")).toEqual("/foo/bar/baz");
expect(mergePaths("/foo/bar/", "/baz")).toEqual("/foo/bar/baz");
expect(mergePaths("/foo/bar", "baz")).toEqual("/foo/bar/baz");
});