mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
33 lines
955 B
TypeScript
33 lines
955 B
TypeScript
import { describe, expect, test } from 'bun:test'
|
|
import { markdownToPlainText } from '../send.js'
|
|
|
|
describe('markdownToPlainText', () => {
|
|
test('removes bold markers', () => {
|
|
expect(markdownToPlainText('**bold**')).toBe('bold')
|
|
})
|
|
|
|
test('removes italic markers', () => {
|
|
expect(markdownToPlainText('*italic*')).toBe('italic')
|
|
})
|
|
|
|
test('removes inline code backticks', () => {
|
|
expect(markdownToPlainText('`code`')).toBe('code')
|
|
})
|
|
|
|
test('removes code block fences', () => {
|
|
expect(markdownToPlainText("```js\nconsole.log('hi');\n```"))
|
|
.toBe("console.log('hi');")
|
|
})
|
|
|
|
test('converts links to text with URL', () => {
|
|
expect(markdownToPlainText('[click](https://example.com)')).toBe(
|
|
'click (https://example.com)',
|
|
)
|
|
})
|
|
|
|
test('handles mixed markdown', () => {
|
|
expect(markdownToPlainText('# Hello\n\n**bold** and *italic* with `code`'))
|
|
.toBe('Hello\n\nbold and italic with code')
|
|
})
|
|
})
|