mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 00:35:51 +00:00
feat: 接入 weixin 服务层与命令入口
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
32
src/services/weixin/__tests__/send.test.ts
Normal file
32
src/services/weixin/__tests__/send.test.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user