test: remove duplicate result assertions before throwing guards

This commit is contained in:
morluto
2026-10-09 02:58:03 +08:00
parent 5945915f91
commit a1b7d40bb0
33 changed files with 0 additions and 62 deletions
@@ -56,7 +56,6 @@ describe("CDP target inventory", () => {
allowed_origins: ["https://allowed.example"],
});
expect(result.ok).toBe(true);
if (!result.ok) throw result.error;
expect(result.value.targets).toHaveLength(targets.length);
expect(result.value.targets[0]?.target_id).toBe("target-0000");
@@ -25,7 +25,6 @@ describe("CdpBrowserProvider navigation timeline", () => {
}),
);
expect(result.ok).toBe(true);
if (!result.ok) throw result.error;
expect(result.value.timeline).toHaveLength(additionalEvents + 6);
expect(result.value.completeness.truncated_sections).not.toContain(
@@ -281,7 +281,6 @@ describe("runtime lifecycle and invalid producer data", () => {
},
},
);
expect(result.ok).toBe(false);
if (result.ok)
throw new Error("Cancellation must not produce successful evidence");
expect(result.error._tag).toBe("AnalysisCancelledError");
@@ -297,7 +296,6 @@ describe("runtime lifecycle and invalid producer data", () => {
unsupportedMethods: ["Profiler.stopPreciseCoverage"],
});
const result = await provider.observeExecution(execution);
expect(result.ok).toBe(false);
if (result.ok) throw new Error("Failed cleanup must not return success");
expect(result.error.cleanupIncomplete).toBe(true);
expect(