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:
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user