Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: keep finalization before-exit ref alive
Signed-off-by: Tim Perry <[email protected]>
  • Loading branch information
pimterry committed Jul 15, 2026
commit e5bbbdda8a6e9a0f0373d79a1b5933239a969a4c
5 changes: 4 additions & 1 deletion test/fixtures/process/before-exit.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { strictEqual } from 'assert'

let obj

function setup() {
const obj = { foo: 'bar' }
obj = { foo: 'bar' }
process.finalization.registerBeforeExit(obj, shutdown)
}

Expand All @@ -27,5 +29,6 @@ function shutdown(obj, event) {
setup()

process.on('exit', function () {
strictEqual(obj.foo, 'bar')
strictEqual(shutdownCalled, true)
})
Loading