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.

22 lines
369 B

3 years ago
'use strict'
const { register } = require('../..')
const assert = require('assert')
function setup () {
const obj = { foo: 'bar' }
register(obj, shutdown)
}
let shutdownCalled = false
function shutdown (obj) {
shutdownCalled = true
assert.strictEqual(obj.foo, 'bar')
}
setup()
process.on('exit', function () {
assert.strictEqual(shutdownCalled, true)
})