mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-06 07:11:55 +09:00
15 lines
559 B
TypeScript
15 lines
559 B
TypeScript
import { expect, test } from "vitest";
|
|
import { isPathnamePattern } from "./url-pattern";
|
|
|
|
test("check pathname is pattern", () => {
|
|
expect(isPathnamePattern("/:name")).toEqual(true);
|
|
expect(isPathnamePattern("/:slug*")).toEqual(true);
|
|
expect(isPathnamePattern("/:id?")).toEqual(true);
|
|
expect(isPathnamePattern("/*")).toEqual(true);
|
|
|
|
expect(isPathnamePattern("")).toEqual(false);
|
|
expect(isPathnamePattern("/")).toEqual(false);
|
|
expect(isPathnamePattern("/blog")).toEqual(false);
|
|
expect(isPathnamePattern("/blog/post-name")).toEqual(false);
|
|
});
|