This commit is contained in:
24
packages/cli/tests/renderer.test.ts
Normal file
24
packages/cli/tests/renderer.test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { renderMarkdown } from '../src/renderer.js';
|
||||
|
||||
describe('renderMarkdown', () => {
|
||||
it('renders bold text (no ** in output)', () => {
|
||||
const result = renderMarkdown('This is **bold** text');
|
||||
expect(result).not.toContain('**');
|
||||
expect(result).toContain('bold');
|
||||
});
|
||||
|
||||
it('renders list items (has bullet)', () => {
|
||||
const result = renderMarkdown('- first item\n- second item');
|
||||
// The bullet character used by chalk
|
||||
expect(result).toContain('\u2022');
|
||||
expect(result).toContain('first item');
|
||||
expect(result).toContain('second item');
|
||||
});
|
||||
|
||||
it('passes plain text through', () => {
|
||||
const input = 'Hello, this is just plain text.';
|
||||
const result = renderMarkdown(input);
|
||||
expect(result).toContain('Hello, this is just plain text.');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user