fastify / fastify-rate-limit

A low overhead rate limiter for your routes
MIT License
504 stars 71 forks source link

swap out ms for @lukeed/ms #312

Closed gurgunday closed 1 year ago

gurgunday commented 1 year ago

The old ms is being replaced with this one in most fastify plugins

Reference: https://github.com/fastify/fastify-sensible/pull/132

TLDR: it's faster

Checklist

gurgunday commented 1 year ago

Not related, but having trouble understanding this coverage report, these uncovered lines are literally covered?

# time=10834.974ms
--------------------------|---------|----------|---------|---------|-------------------
File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
--------------------------|---------|----------|---------|---------|-------------------
All files                 |   98.44 |    96.26 |     100 |     100 |                   
 fastify-rate-limit       |     100 |    98.24 |     100 |     100 |                   
  index.js                |     100 |    98.24 |     100 |     100 | 159-167           
mcollina commented 1 year ago

Those lines do not look like to be covered in the sense that the "else" of the if is never exerciesed

Uzlopak commented 1 year ago

If you run the test locally than if the lines are red, it means uncovere lines. Like a if clause not met. If it is yellow it means uncovered branch like var1 || var2, where var1 is covered but var2 not.

gurgunday commented 1 year ago

Today I learned 😁

Thanks for the info!