mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
18 lines
586 B
TypeScript
18 lines
586 B
TypeScript
import { assertEquals } from '@std/assert';
|
|
|
|
import { extractIdentifier } from './lookup.ts';
|
|
|
|
Deno.test('extractIdentifier', () => {
|
|
assertEquals(
|
|
extractIdentifier('https://njump.me/npub1q3sle0kvfsehgsuexttt3ugjd8xdklxfwwkh559wxckmzddywnws6cd26p'),
|
|
'npub1q3sle0kvfsehgsuexttt3ugjd8xdklxfwwkh559wxckmzddywnws6cd26p',
|
|
);
|
|
assertEquals(
|
|
extractIdentifier('npub1q3sle0kvfsehgsuexttt3ugjd8xdklxfwwkh559wxckmzddywnws6cd26p'),
|
|
'npub1q3sle0kvfsehgsuexttt3ugjd8xdklxfwwkh559wxckmzddywnws6cd26p',
|
|
);
|
|
assertEquals(
|
|
extractIdentifier('alex'),
|
|
undefined,
|
|
);
|
|
});
|