Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
dwickern committed Sep 22, 2022
1 parent 934be7b commit ccf7879
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,18 @@ test('should accept an option to encapsulate', t => {
t.notOk(fastify.hasDecorator('encapsulated'))
})
})

test('should check dependencies when encapsulated', t => {
t.plan(1)
const fastify = Fastify()

fastify.register(fp((fastify, opts, next) => next(), {
name: 'test',
dependencies: ['missing-dependency-name'],
encapsulate: true
}))

fastify.ready(err => {
t.equal(err.message, "The dependency 'missing-dependency-name' of plugin 'test' is not registered")
})
})

0 comments on commit ccf7879

Please sign in to comment.