MCPcopy
hub / github.com/fastify/fastify / assertsThrowOnUndeclaredDecorator

Function assertsThrowOnUndeclaredDecorator

test/decorator.test.js:1259–1267  ·  view source on GitHub ↗
(notDecorated, instanceType)

Source from the content-addressed store, hash-verified

1257 t.plan(9)
1258
1259 function assertsThrowOnUndeclaredDecorator (notDecorated, instanceType) {
1260 try {
1261 notDecorated.getDecorator('foo')
1262 t.assert.fail()
1263 } catch (e) {
1264 t.assert.deepEqual(e.code, 'FST_ERR_DEC_UNDECLARED')
1265 t.assert.deepEqual(e.message, `No decorator 'foo' has been declared on ${instanceType}.`)
1266 }
1267 }
1268
1269 const fastify = Fastify()
1270 fastify.register(child => {

Callers 1

decorator.test.jsFile · 0.85

Calls 1

getDecoratorMethod · 0.65

Tested by

no test coverage detected