MCPcopy
hub / github.com/fastify/fastify / plugin

Function plugin

test/close.test.js:132–144  ·  view source on GitHub ↗
(instance, opts, done)

Source from the content-addressed store, hash-verified

130 fastify.register(plugin)
131
132 function plugin (instance, opts, done) {
133 instance.decorate('test', true)
134 instance.addHook('onClose', onClose)
135 t.assert.ok(instance.prototype === fastify.prototype)
136
137 function onClose (i, done) {
138 t.assert.ok(i.test)
139 t.assert.strictEqual(i, instance)
140 done()
141 }
142
143 done()
144 }
145
146 fastify.close((err) => {
147 t.assert.ifError(err)

Callers

nothing calls this directly

Calls 2

addHookMethod · 0.80
doneFunction · 0.50

Tested by

no test coverage detected