Files
dacli/tests/unit/verify-runner.test.ts
sushub f403a7e80e import: ssw/dacli@eea0ebc (2026-08-12) 起点版本
本仓 2026-08-12 从 ssw main (192.168.1.18:13300/ssw/ssw-mvp) 的
dacli/ subpath 抽取,作为独立仓托管到 gitea:3000/ssw/dacli.git。

- 工作树为 ssw main dacli subpath 最新版 (110 commit, 08-12)
- 历史未带 ssw main 整体历史(避免大仓污染)
- 此为新仓基线 commit,未来以本仓历史为主
2026-08-12 15:58:06 +08:00

36 lines
1.1 KiB
TypeScript

// dacli/tests/unit/verify-runner.test.ts
import { describe, it, expect, vi, beforeEach } from 'vitest'
import { checkDeps, runVerify } from '../../src/core/verify-runner'
describe('checkDeps', () => {
beforeEach(() => {
vi.restoreAllMocks()
})
it('探测到 playwright + chromium + jnpf 全部就绪时全 true', async () => {
// 假设: 全装
const deps = await checkDeps()
expect(deps).toMatchObject({
playwright: true,
chromium: true,
jnpf: true,
menuMounted: expect.any(Boolean),
})
})
it('playwright 未装时返 playwright=false', async () => {
// 不测 (依赖环境), 仅文档化期望
})
})
describe('runVerify', () => {
it('子进程 stdout 返 JSON ok=true 时透传 (真实 paymentapply 跑通)', async () => {
const result = await runVerify('585398402720727621', 'paymentapply', 'workSystem', {
timeout: 60000,
})
expect(result).toHaveProperty('ok')
expect(result).toHaveProperty('steps')
expect(result).toHaveProperty('screenshots')
}, 90000) // 90s vitest timeout
})