Files
deepseek-harness/apps/desktop/tests/smoke-runtime.spec.ts
T
yudshj 0f96381169 fix(desktop): 打包冒烟检查不再要求 Office 技能提供 path
Office 技能 provider 只提供 resourceBase,从不设置可选字段 path,因此 smoke-runtime.ts 的判定在所有平台上都必然失败。判定改为只检查行为结果:4 个 Office 技能都能列出,且正文非空。

判定抽成 assertOfficeSkillsLoadable,由新增单测和 office-resources.e2e.ts 共用。判定与真实 provider 不一致时,PR 阶段的 E2E 就会失败。

Fixes #7998
2026-11-06 08:12:51 +08:00

36 lines
1.4 KiB
TypeScript

/** Behavioral checks for packaged Office skill probe results. */
import { describe, expect, it } from 'vitest'
import { assertOfficeSkillsLoadable } from '../scripts/smoke-runtime.ts'
const loadedSkills = [
{ name: 'office', bytes: 772 },
{ name: 'office-docx', bytes: 4543 },
{ name: 'office-pptx', bytes: 5167 },
{ name: 'office-xlsx', bytes: 5611 },
]
describe('assertOfficeSkillsLoadable', () => {
it('accepts all four Office skills with nonempty bodies and no path', () => {
expect(() => { assertOfficeSkillsLoadable(loadedSkills) }).not.toThrow()
})
it('rejects an unlisted or empty Office skill and reports every result', () => {
const results = loadedSkills.map(skill => skill.name === 'office-docx' ? { ...skill, bytes: 0 } : skill)
expect(() => { assertOfficeSkillsLoadable(results) }).toThrow(
`desktop runtime: packaged Office skills are not loadable: ${JSON.stringify(results)}`,
)
})
it('rejects results missing a bundled Office skill', () => {
const results = loadedSkills.filter(skill => skill.name !== 'office-xlsx')
expect(() => { assertOfficeSkillsLoadable(results) }).toThrow(
`desktop runtime: packaged Office skills are not loadable: ${JSON.stringify(results)}`,
)
})
it('ignores empty results for skills outside the bundled Office set', () => {
expect(() => { assertOfficeSkillsLoadable([...loadedSkills, { name: 'other', bytes: 0 }]) }).not.toThrow()
})
})