import { describe, it, expect } from 'vitest'; import { renderAsciiDocLite } from '../utils/asciidoc-lite'; describe('renderAsciiDocLite', () => { it('returns empty string for empty input', () => { expect(renderAsciiDocLite('')).toBe(''); }); it('wraps plain text in

', () => { expect(renderAsciiDocLite('Hello world')).toBe('

Hello world

'); }); it('creates separate paragraphs on blank lines', () => { const result = renderAsciiDocLite('First\n\nSecond'); expect(result).toContain('

First

'); expect(result).toContain('

Second

'); }); it('renders headings (level + 1, h1 reserved)', () => { expect(renderAsciiDocLite('== Heading 2')).toContain('

Heading 2

'); expect(renderAsciiDocLite('=== Heading 3')).toContain('

Heading 3

'); expect(renderAsciiDocLite('===== Heading 5')).toContain('
Heading 5
'); }); it('renders bold text', () => { expect(renderAsciiDocLite('some *bold* text')).toContain('bold'); }); it('renders italic text', () => { expect(renderAsciiDocLite('some _italic_ text')).toContain('italic'); }); it('renders monospace text', () => { expect(renderAsciiDocLite('use `code` here')).toContain('code'); }); it('renders AsciiDoc links with label', () => { const result = renderAsciiDocLite('see https://example.com[label] here'); expect(result).toContain('label'); }); it('renders bare URLs as links', () => { const result = renderAsciiDocLite('visit https://example.com now'); expect(result).toContain(' { const result = renderAsciiDocLite('* item one\n* item two'); expect(result).toContain('