fix(background-agent): reset process.exitCode to 0 between cleanup tests

CI test suite exited 1 despite 0 failing tests because process-cleanup.test.ts
assertions left process.exitCode=1 in place. The afterEach hook only reset to
originalExitCode (which starts undefined), not 0, so Bun picked up exitCode=1
on shutdown and reported the shared batch as failing.

Explicitly set process.exitCode = 0 in beforeEach and afterEach so each test
starts and ends with a clean exit state.
This commit is contained in:
YeonGyu-Kim
2026-04-18 19:57:26 +09:00
parent 257b6cf951
commit aa79284dc5
@@ -15,10 +15,9 @@ type CleanupManager = {
describe("#given process cleanup registration", () => {
const registeredManagers: CleanupManager[] = []
const originalExitCode = process.exitCode
beforeEach(() => {
process.exitCode = originalExitCode
process.exitCode = 0
registeredManagers.length = 0
_resetForTesting()
})
@@ -28,7 +27,7 @@ describe("#given process cleanup registration", () => {
unregisterManagerForCleanup(manager)
}
process.exitCode = originalExitCode
process.exitCode = 0
_resetForTesting()
})