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) -})