Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(upgrade-restart): restore the process exit code after the misplaced --dry-run case

garrytan3abea4137d70
diff --git a/test/upgrade-restart.test.ts b/test/upgrade-restart.test.ts
index 2198913c66..faa04818af 100644
--- a/test/upgrade-restart.test.ts
+++ b/test/upgrade-restart.test.ts
@@ -396,7 +396,7 @@ describe('--dry-run belongs to --restart-only (#2185)', () => {
expect(currentExitCode()).toBe(exitCodeForCode('invalid_params'));
} finally {
process.stderr.write = write;
- process.exitCode = prevExit;
+ process.exitCode = prevExit ?? 0;
_resetCliExitVerdictForTests();
}
expect(writes.join('')).toContain('--dry-run previews only a restart');