Skip to content

Commit

Permalink
Ensure that error-in-post test is run (#1096)
Browse files Browse the repository at this point in the history
* Ensure that error-in-post test is run

* fixup! adding t.plan(1) and removing beforeExit check

As per Github comment #1096 (comment)
  • Loading branch information
trivikr authored and mcollina committed Aug 25, 2018
1 parent 3895a75 commit 6bce249
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions test/error-in-post.js → test/error-in-post.test.js
Expand Up @@ -4,8 +4,6 @@ const t = require('tap')
const Fastify = require('..')
const fastify = Fastify()

let errored = false

fastify.route({
method: 'POST',
path: '/jsonBody',
Expand All @@ -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)
})

0 comments on commit 6bce249

Please sign in to comment.