import { Of } from "silentium"; import { expect, test, vi } from "vitest"; import { Path } from "../behaviors"; import { RegexpMatch } from "./RegexpMatch"; test("RegexpMatch._main.test", () => { const $url = Of("http://domain.com/some/url/"); const $matched = Path(RegexpMatch(Of("/(s\\w+)/"), $url), Of("0")); const g = vi.fn(); $matched.then(g); expect(g).toHaveBeenLastCalledWith("/some/"); });