refactor: move mergePaths() to utils.ts (#2905)
This commit is contained in:
+1
-15
@@ -1,10 +1,5 @@
|
||||
import { expect } from "@std/expect";
|
||||
import {
|
||||
IS_PATTERN,
|
||||
mergePaths,
|
||||
pathToPattern,
|
||||
UrlPatternRouter,
|
||||
} from "./router.ts";
|
||||
import { IS_PATTERN, pathToPattern, UrlPatternRouter } from "./router.ts";
|
||||
|
||||
Deno.test("IS_PATTERN", () => {
|
||||
expect(IS_PATTERN.test("/foo")).toEqual(false);
|
||||
@@ -176,12 +171,3 @@ Deno.test("pathToPattern", async (t) => {
|
||||
expect(() => pathToPattern("foo/[[name]]-bar")).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user