jhurliman / node-rate-limiter

A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled
MIT License
1.5k stars 132 forks source link

Eliminates module-scoped variables from tokenbucket-test. #46

Closed C-Saunders closed 6 years ago

C-Saunders commented 6 years ago

The bucket is available in the nested scopes. The time variables are now attached to the context objects.

This change is intended to facilitate the addition of more tests, such as would be nice to have for https://github.com/jhurliman/node-rate-limiter/issues/18, to add tests for parent buckets, etc.

jhurliman commented 6 years ago

Try merging the latest master into this branch; that should clear up the CI failure.