fastify
Advanced tools
Comparing version 0.25.0 to 0.25.1
@@ -64,4 +64,3 @@ 'use strict' | ||
fastify.onClose((err, instance, done) => { | ||
if (err) throw err | ||
fastify.onClose((instance, done) => { | ||
if (listening) { | ||
@@ -68,0 +67,0 @@ instance.server.close(done) |
{ | ||
"name": "fastify", | ||
"version": "0.25.0", | ||
"version": "0.25.1", | ||
"description": "Fast and low overhead web framework, for Node.js", | ||
@@ -71,3 +71,3 @@ "main": "fastify.js", | ||
"ajv": "^5.2.2", | ||
"avvio": "^2.0.2", | ||
"avvio": "^2.0.3", | ||
"fast-json-stringify": "^0.12.2", | ||
@@ -77,3 +77,3 @@ "fast-safe-stringify": "^1.2.0", | ||
"fastseries": "^1.7.2", | ||
"find-my-way": "^1.2.1", | ||
"find-my-way": "^1.3.2", | ||
"middie": "^1.0.0", | ||
@@ -80,0 +80,0 @@ "pino-http": "^2.6.1", |
@@ -8,7 +8,6 @@ 'use strict' | ||
test('close callback', t => { | ||
t.plan(5) | ||
t.plan(4) | ||
const fastify = Fastify() | ||
fastify.addHook('onClose', onClose) | ||
function onClose (err, instance, done) { | ||
t.error(err) | ||
function onClose (instance, done) { | ||
t.type(fastify, instance) | ||
@@ -29,8 +28,7 @@ done() | ||
test('inside register', t => { | ||
t.plan(5) | ||
t.plan(4) | ||
const fastify = Fastify() | ||
fastify.register(function (f, opts, next) { | ||
f.addHook('onClose', onClose) | ||
function onClose (err, instance, done) { | ||
t.error(err) | ||
function onClose (instance, done) { | ||
t.type(fastify, instance) | ||
@@ -54,3 +52,3 @@ done() | ||
test('close order', t => { | ||
t.plan(7) | ||
t.plan(5) | ||
const fastify = Fastify() | ||
@@ -60,4 +58,3 @@ const order = [1, 2, 3] | ||
fastify.register(function (f, opts, next) { | ||
f.addHook('onClose', (err, instance, done) => { | ||
t.error(err) | ||
f.addHook('onClose', (instance, done) => { | ||
t.is(order.shift(), 1) | ||
@@ -70,4 +67,3 @@ done() | ||
fastify.addHook('onClose', (err, instance, done) => { | ||
t.error(err) | ||
fastify.addHook('onClose', (instance, done) => { | ||
t.is(order.shift(), 2) | ||
@@ -88,7 +84,6 @@ done() | ||
test('should not throw an error if the server is not listening', t => { | ||
t.plan(3) | ||
t.plan(2) | ||
const fastify = Fastify() | ||
fastify.addHook('onClose', onClose) | ||
function onClose (err, instance, done) { | ||
t.error(err) | ||
function onClose (instance, done) { | ||
t.type(fastify, instance) | ||
@@ -95,0 +90,0 @@ done() |
198964
5460
Updatedavvio@^2.0.3
Updatedfind-my-way@^1.3.2