test: tighten core helper object assertions · openclaw/openclaw@25bfe29
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -38,10 +38,6 @@ 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 | | - |
45 | 41 | beforeEach(() => { |
46 | 42 | resetAgentEventsForTest(); |
47 | 43 | resetClaudeLiveSessionsForTest(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ import {
|
7 | 7 | } from "./inline-eval.js"; |
8 | 8 | |
9 | 9 | function expectInlineEvalDescription(hit: InterpreterInlineEvalHit | null, expected: string) { |
10 | | -expect(hit).toEqual(expect.any(Object)); |
| 10 | +expect(hit).not.toBeNull(); |
11 | 11 | if (hit === null) { |
12 | 12 | throw new Error(`Expected inline eval hit for ${expected}`); |
13 | 13 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,7 @@ import {
|
12 | 12 | |
13 | 13 | function parseSpecOrThrow(spec: string) { |
14 | 14 | const parsed = parseRegistryNpmSpec(spec); |
15 | | -expect(parsed).toEqual(expect.any(Object)); |
| 15 | +expect(parsed).not.toBeNull(); |
16 | 16 | if (parsed === null) { |
17 | 17 | throw new Error(`Expected ${spec} to parse`); |
18 | 18 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。