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", () => {
|
describe("#given process cleanup registration", () => {
|
||||||
const registeredManagers: CleanupManager[] = []
|
const registeredManagers: CleanupManager[] = []
|
||||||
const originalExitCode = process.exitCode
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
process.exitCode = originalExitCode
|
process.exitCode = 0
|
||||||
registeredManagers.length = 0
|
registeredManagers.length = 0
|
||||||
_resetForTesting()
|
_resetForTesting()
|
||||||
})
|
})
|
||||||
@@ -28,7 +27,7 @@ describe("#given process cleanup registration", () => {
|
|||||||
unregisterManagerForCleanup(manager)
|
unregisterManagerForCleanup(manager)
|
||||||
}
|
}
|
||||||
|
|
||||||
process.exitCode = originalExitCode
|
process.exitCode = 0
|
||||||
_resetForTesting()
|
_resetForTesting()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user