import { describe, it, expect } from 'vitest'; import { lexicalToMarkdown } from '../lib/mdx-utils'; describe('lexicalToMarkdown', () => { it('should convert lexical AST to markdown', () => { const ast = { type: 'root', children: [ { type: 'paragraph', children: [ { type: 'text', text: 'Hello ' }, { type: 'text', text: 'World', format: 1 }, // bold ], }, { type: 'heading', tag: 'h2', children: [{ type: 'text', text: 'Title' }], }, ], }; const result = lexicalToMarkdown(ast); expect(result).toBe('Hello **World**\n\n## Title\n\n'); }); });