Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: trust-claim resets the CLI exit verdict after each test (leaked verdict 2 failed upgrade-restart in the same bun process)

garrytancc840ebe9815
diff --git a/test/trust-claim.test.ts b/test/trust-claim.test.ts
index c1f63272cf..f2d3afcdcb 100644
--- a/test/trust-claim.test.ts
+++ b/test/trust-claim.test.ts
@@ -33,6 +33,7 @@ import { explainTrust } from '../src/core/trust/review.ts';
import { TRUST_TIER_RANK } from '../src/core/trust/tier.ts';
import { runTrustScan } from '../src/core/eligibility/scan.ts';
import { runTrustClaimSources } from '../src/commands/trust-claim.ts';
+import { _resetCliExitVerdictForTests } from '../src/core/cli-force-exit.ts';
import { runSetTrust } from '../src/commands/sources-trust.ts';
import { trustSourcesUnclaimedEntry } from '../src/commands/doctor/checks/trust-sources-unclaimed.ts';
import { trustScanEntry } from '../src/commands/doctor/checks/trust-scan.ts';
@@ -55,7 +56,7 @@ beforeAll(async () => {
fresh = empty;
}, 120_000);
afterAll(async () => { await engine.disconnect(); await fresh.disconnect(); });
-afterEach(() => { __setConfirmationIoForTests(null); process.exitCode = 0; });
+afterEach(() => { __setConfirmationIoForTests(null); process.exitCode = 0; _resetCliExitVerdictForTests(); });
const cli = { transport: 'cli' as const, isCallable: () => false, preapproved: () => true };
const render = (fix: unknown) => renderAction(fix as Action, cli);