From 6bce249e04c60914280b5919efdb4ded6a745925 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sat, 25 Aug 2018 12:11:44 -0700 Subject: [PATCH] Ensure that error-in-post test is run (#1096) * Ensure that error-in-post test is run * fixup! adding t.plan(1) and removing beforeExit check As per Github comment https://github.com/fastify/fastify/pull/1096#issuecomment-415986858 --- test/{error-in-post.js => error-in-post.test.js} | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) rename test/{error-in-post.js => error-in-post.test.js} (83%) diff --git a/test/error-in-post.js b/test/error-in-post.test.js similarity index 83% rename from test/error-in-post.js rename to test/error-in-post.test.js index 0cade21130..f19c2cd1af 100644 --- a/test/error-in-post.js +++ b/test/error-in-post.test.js @@ -4,8 +4,6 @@ const t = require('tap') const Fastify = require('..') const fastify = Fastify() -let errored = false - fastify.route({ method: 'POST', path: '/jsonBody', @@ -23,14 +21,10 @@ const reqOpts = { } process.on('uncaughtException', (err) => { - errored = true t.equal(err.message, 'kaboom') }) fastify.inject(reqOpts, (e, res) => { + t.plan(1) t.fail('should not be called') }) - -process.on('beforeExit', () => { - t.ok(errored) -})