import linkify from "./linkify"; import { describe, expect, test } from "vitest"; describe("linkify", () => { test("should wrap links", () => { expect(linkify("https://example.com")).eq( `https://example.com` ); }); test("with surrounding text", () => { expect(linkify("hello http://foo.bar/ world")).eq( `hello http://foo.bar/ world` ); }); test("with query and hash", () => { expect(linkify("a http://b.c/?d=e#f g")).eq( `a http://b.c/?d=e#f g` ); }); test("with multiple links", () => { expect(linkify("hello http://foo.bar/ world https://bar.baz/ tadda!")).eq( `hello http://foo.bar/ world https://bar.baz/ tadda!` ); }); });