import { assertEquals } from "@std/assert"; import { mentionedUsernames, mentionsEveryone } from "../mention.ts"; Deno.test("mentionedUsernames: local names and remote handles, once each", () => { assertEquals( mentionedUsernames( "hi @Bob and @alice@Music.example. Also @carol@localhost:8001, @bob!", ), ["bob", "alice@music.example", "carol@localhost:8001"], ); }); Deno.test("mentionedUsernames: emails, code, links and URLs mention no one", () => { assertEquals( mentionedUsernames( "mail bob@example.com, `@code`, [@x](https://a.example), https://a.example/@dan", ), [], ); assertEquals(mentionsEveryone("hey @everyone"), true); });