(instance, opts, done)
| 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) |