Skip to content

Conversation

@anthonyringoet
Copy link
Contributor

Checklist

-----------|---------|----------|---------|---------|-------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------|---------|----------|---------|---------|-------------------
All files  |      98 |    93.33 |     100 |   97.78 |
 plugin.js |      98 |    93.33 |     100 |   97.78 | 58
-----------|---------|----------|---------|---------|-------------------

The only uncovered line 58 does not seem to be reachable. If this is a function, it will be evaluated at the time the plugin is registered while giving access to the Fastify instance. The plugin receives the return value instead of the original function. I might be missing something though :)

https://www.fastify.io/docs/latest/Plugins/#plugin-options

@climba03003
Copy link
Member

It should be reachable by doing this.

fastify.register(plugin, function() {
  return function() {} // note that we return a function here and which will be passed toward the plugin.
})

@zekth
Copy link
Member

zekth commented May 15, 2021

Once 100% reached could you please delete the .taprc because we can get rid of this : https://github.com/fastify/fastify-caching/blob/master/.taprc#L1

@anthonyringoet
Copy link
Contributor Author

anthonyringoet commented May 15, 2021

Thanks for the feedback! Pushed the updates.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@climba03003 climba03003 linked an issue May 16, 2021 that may be closed by this pull request
Copy link
Member

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@climba03003 climba03003 merged commit 1ca37b9 into fastify:master May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Coverage 100%

4 participants