mirror of
https://github.com/morluto/rea
synced 2026-10-28 06:46:47 -04:00
735c10059c
Move each error family out of domain/errors.ts into its own module (base, core, provider selection/adapter, browser observation, artifact, evidence, unknown registry, hopper, configuration) and relocate AnalysisErrorProjection to analysisErrorProjection. Migrate all 162 importers to the owning modules and delete errors.ts. No re-export shims; behavior is unchanged.
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
import {
|
|
ProcessCaptureError,
|
|
processCaptureCancelled,
|
|
} from "./ProcessCaptureError.js";
|
|
|
|
describe("process capture error projection", () => {
|
|
it("reports incomplete cleanup resources without exposing its cause", () => {
|
|
const projected = projectAnalysisError(
|
|
new ProcessCaptureError("terminal cleanup failed", {
|
|
cause: new Error("secret-token"),
|
|
reason: "cleanup_incomplete",
|
|
cleanupResources: ["process_group"],
|
|
}),
|
|
);
|
|
|
|
expect(projected).toMatchObject({
|
|
code: "cleanup_incomplete",
|
|
details: { cleanup: "incomplete", resources: ["process_group"] },
|
|
});
|
|
expect(JSON.stringify(projected)).not.toContain("secret-token");
|
|
});
|
|
|
|
it("projects caller cancellation as completed cleanup", () => {
|
|
expect(projectAnalysisError(processCaptureCancelled())).toMatchObject({
|
|
code: "cancelled",
|
|
category: "cancelled",
|
|
details: { operation: "process_capture", cleanup: "complete" },
|
|
});
|
|
});
|
|
});
|