From 25bfe290241dcd983cc46a39edab1e5bd56c107f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 03:04:29 +0100 Subject: [PATCH] test: tighten core helper object assertions --- src/agents/cli-runner.spawn.test.ts | 4 ---- src/infra/command-analysis/inline-eval.test.ts | 2 +- src/infra/npm-registry-spec.test.ts | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/agents/cli-runner.spawn.test.ts b/src/agents/cli-runner.spawn.test.ts index bb2a0415559..4a9e3129884 100644 --- a/src/agents/cli-runner.spawn.test.ts +++ b/src/agents/cli-runner.spawn.test.ts @@ -38,10 +38,6 @@ import { createClaudeApiErrorFixture } from "./test-helpers/claude-api-error-fix type ProcessSupervisor = ReturnType; type SupervisorSpawnFn = ProcessSupervisor["spawn"]; -async function expectPathMissing(targetPath: string): Promise { - await expect(fs.access(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); -} - beforeEach(() => { resetAgentEventsForTest(); resetClaudeLiveSessionsForTest(); diff --git a/src/infra/command-analysis/inline-eval.test.ts b/src/infra/command-analysis/inline-eval.test.ts index 2bdae3e039c..557ae8a85fc 100644 --- a/src/infra/command-analysis/inline-eval.test.ts +++ b/src/infra/command-analysis/inline-eval.test.ts @@ -7,7 +7,7 @@ import { } from "./inline-eval.js"; function expectInlineEvalDescription(hit: InterpreterInlineEvalHit | null, expected: string) { - expect(hit).toEqual(expect.any(Object)); + expect(hit).not.toBeNull(); if (hit === null) { throw new Error(`Expected inline eval hit for ${expected}`); } diff --git a/src/infra/npm-registry-spec.test.ts b/src/infra/npm-registry-spec.test.ts index ff75dea03ba..14ac62d789b 100644 --- a/src/infra/npm-registry-spec.test.ts +++ b/src/infra/npm-registry-spec.test.ts @@ -12,7 +12,7 @@ import { function parseSpecOrThrow(spec: string) { const parsed = parseRegistryNpmSpec(spec); - expect(parsed).toEqual(expect.any(Object)); + expect(parsed).not.toBeNull(); if (parsed === null) { throw new Error(`Expected ${spec} to parse`); }