返回 oh-my-ppt
prompts.test.ts
根目录 / tests / unit / thinking / prompts.test.ts
1 import { describe, expect, it } from 'vitest'
2 import { BASE_THINKING_PROMPT } from '../../../src/main/thinking/prompts/base'
3 import { DRAFT_STAGE_PROMPT } from '../../../src/main/thinking/prompts/draft'
4 import { OUTLINE_STAGE_PROMPT } from '../../../src/main/thinking/prompts/outline'
5 import { READY_STAGE_PROMPT } from '../../../src/main/thinking/prompts/ready'
6 import { REFINE_STAGE_PROMPT } from '../../../src/main/thinking/prompts/refine'
7
8 describe('thinking prompts', () => {
9 it('does not hard-code English confirm-and-generate replies', () => {
10 const prompts = [
11 OUTLINE_STAGE_PROMPT,
12 DRAFT_STAGE_PROMPT,
13 REFINE_STAGE_PROMPT,
14 READY_STAGE_PROMPT
15 ]
16
17 for (const prompt of prompts) {
18 expect(prompt).not.toContain('You can click **Confirm & Generate**')
19 expect(prompt).not.toContain('Looks good! Click **Confirm & Generate**')
20 expect(prompt).not.toContain('User will click "Confirm & Generate"')
21 }
22 })
23
24 it('requires an internal ReAct loop without leaking reasoning', () => {
25 expect(BASE_THINKING_PROMPT).toContain('Use an internal ReAct loop every turn')
26 expect(BASE_THINKING_PROMPT).toContain('Do not reveal hidden reasoning or tool chatter')
27 })
28
29 it('blocks unsupported exact metrics for source-less thinking', () => {
30 expect(BASE_THINKING_PROMPT).toContain('Do not write exact metrics')
31 expect(DRAFT_STAGE_PROMPT).toContain('If no sources support exact metrics')
32 expect(OUTLINE_STAGE_PROMPT).toContain('For source-less topics')
33 })
34 })
35
35 lines TYPESCRIPT