test: remove duplicate result assertions before throwing guards

This commit is contained in:
morluto committed 2026-10-09 02:58:03 +08:00
1 parent 5945915f91
commit a1b7d40bb0
33 files changed
-62

No files matched your search

@@ -139,7 +139,6 @@ describe("analysis provider registry: binding failures and cancellation", () =>
const unsupported = await new AnalysisProviderRegistry([
candidate("alpha", { available: false }).provider,
]).select(ARTIFACT_TARGET, "alpha");
expect(unsupported.ok).toBe(false);
if (unsupported.ok)
throw new Error("expected unsupported target rejection");
expect(unsupported.error).toBeInstanceOf(ProviderSelectionError);
@@ -181,7 +180,6 @@ describe("analysis provider registry: binding failures and cancellation", () =>
});
}
const explicit = await automatic.select(ARTIFACT_TARGET, "alpha");
expect(explicit.ok).toBe(false);
if (explicit.ok) throw new Error("expected provider selection rejection");
expect(explicit.error).toBeInstanceOf(ProviderSelectionError);
if (explicit.error instanceof ProviderSelectionError)
@@ -213,7 +211,6 @@ describe("analysis provider registry: binding failures and cancellation", () =>
const explicit = await new AnalysisProviderRegistry([
failed.provider,
]).select(DATABASE_TARGET, "failed");
expect(explicit.ok).toBe(false);
if (explicit.ok) throw new Error("expected provider selection rejection");
expect(explicit.error).toBeInstanceOf(ProviderSelectionError);
if (explicit.error instanceof ProviderSelectionError)
@@ -230,7 +230,6 @@ describe("analysis snapshot cache partitioning", () => {
ANALYSIS_SNAPSHOT_PROFILE,
createEvidenceBundle([evidence]),
);
expect(exported.ok).toBe(true);
if (!exported.ok) throw new Error("snapshot export failed");
const tampered = structuredClone(exported.value);
const tamperedEntry = tampered.entries[0];