Files
reverse-engineering-anything/src/application/EnhancedInputDiagnostics.test.ts
T
morluto 352a846127 test: reduce brittle assertions and test-only runtime paths (#9289)
* test: focus assertions on behavioral evidence

Prune redundant and wording-coupled checks while retaining diagnostic, parser, recovery, and cleanup coverage.

* refactor: remove test-only wrappers and duplicate checks

Exercise production operations through test fixtures, remove unused adapters, and keep managed-member uncertainty guidance under its existing owner.

* test: focus process validation on diagnostic facts

* refactor: remove test-only runtime helpers

Move semantic evidence fixture setup out of runtime and remove unused Windows settle recovery helpers while checking configured defaults independently.

* test: focus artifact diagnostics on format facts

* test: verify retained cleanup guidance delivery
2026-11-08 02:02:31 +08:00

26 lines
1.1 KiB
TypeScript

import { expect, it, vi } from "vitest";
import { EnhancedTools } from "./EnhancedTools.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
it("preserves field diagnostics for rejected enhanced tool inputs", async () => {
const execute = vi.fn();
const tools = new EnhancedTools({ execute });
const result = await tools.execute("trace_native_values", { procedure: "" });
if (result.ok) throw new Error("expected an input failure");
expect(projectAnalysisError(result.error)).toMatchObject({
code: "invalid_request",
details: {
operation: "trace_native_values",
issues: [{ path: ["procedure"], reason: "out_of_range", minimum: 1 }],
},
});
expect(execute).not.toHaveBeenCalled();
const sibling = await tools.execute("batch_decompile", { addresses: "bad" });
if (sibling.ok) throw new Error("expected an input failure");
expect(projectAnalysisError(sibling.error)).toMatchObject({
details: { issues: [{ path: ["addresses"], reason: "invalid_type" }] },
});
expect(execute).not.toHaveBeenCalled();
});