test: tighten cli runner cleanup assertion · openclaw/openclaw@b5a66a0
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -38,6 +38,10 @@ import { createClaudeApiErrorFixture } from "./test-helpers/claude-api-error-fix
|
38 | 38 | type ProcessSupervisor = ReturnType<typeof getProcessSupervisor>; |
39 | 39 | type SupervisorSpawnFn = ProcessSupervisor["spawn"]; |
40 | 40 | |
| 41 | +async function expectPathMissing(targetPath: string): Promise<void> { |
| 42 | +await expect(fs.access(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 43 | +} |
| 44 | + |
41 | 45 | beforeEach(() => { |
42 | 46 | resetAgentEventsForTest(); |
43 | 47 | resetClaudeLiveSessionsForTest(); |
@@ -455,7 +459,7 @@ describe("runCliAgent spawn path", () => {
|
455 | 459 | }, |
456 | 460 | }), |
457 | 461 | ); |
458 | | -await expect(fs.access(pluginDir)).rejects.toThrow(); |
| 462 | +await expectPathMissing(pluginDir); |
459 | 463 | } finally { |
460 | 464 | await fs.rm(workspaceDir, { recursive: true, force: true }); |
461 | 465 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。