import { describe, expect, test } from 'bun:test'; await import('../jsdom'); const { sanitizeHTML } = await import('../../src/utils/sanitize'); describe('sanitizeHTML', () => { test('keeps allowed tags and attributes', () => { let html = '
Hello world! bsky.app
'; expect(sanitizeHTML(html)).toBe(html); }); test('removes disallowed tags while keeping their text content', () => { let html = 'Hello code x
Hello code x
Hi
'; expect(sanitizeHTML(html)).toBe('Hi
'); }); test('removes unsafe link URLs', () => { expect(sanitizeHTML('x')).toBe('x'); }); });