Files
Kmake/test/fixtures/process/close.mjs

19 lines
326 B
JavaScript
Raw Normal View History

2026-05-26 23:36:42 -07:00
import { strictEqual } from 'assert'
function setup() {
const obj = { foo: 'bar' }
process.finalization.register(obj, shutdown)
}
let shutdownCalled = false
function shutdown(obj) {
shutdownCalled = true
strictEqual(obj.foo, 'bar')
}
setup()
process.on('exit', function () {
strictEqual(shutdownCalled, true)
})