You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
417 B

'use strict'
const { register } = require('../..')
const assert = require('assert')
function setup () {
let obj = { foo: 'bar' }
register(obj, shutdown)
setImmediate(function () {
obj = undefined
gc() // eslint-disable-line
})
}
let shutdownCalled = false
function shutdown (obj) {
shutdownCalled = true
}
setup()
process.on('exit', function () {
assert.strictEqual(shutdownCalled, false)
})