011bd6d4ca
交付写作核心(TipTap、自动保存、分卷分章)、Onboarding、7 主题与双语 i18n、快捷键设置;主进程使用 node:sqlite;补全 Vitest 与 Playwright E2E;统一 design/ 目录并移除 desigin 拼写错误路径。 Co-authored-by: Cursor <cursoragent@cursor.com>
13 lines
342 B
TypeScript
13 lines
342 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { countWords } from '../../src/main/services/word-count'
|
|
|
|
describe('countWords', () => {
|
|
it('counts CJK characters excluding whitespace', () => {
|
|
expect(countWords('林远深吸一口气')).toBe(7)
|
|
})
|
|
|
|
it('returns 0 for empty', () => {
|
|
expect(countWords('')).toBe(0)
|
|
})
|
|
})
|