Home Reference Source Test Repository

Test

Description Identifier Count

should not error if not given a config

-

should return an object

-

should default config.limit to null

-

should default config.incrementInterval to null

-

should default config.increment to null

-

should create tokenBuckets

-

should return an object

-

should assign given incrementInterval to config.limit

-

should assign given incrementInterval to config.incrementInterval

-

should assign given incrementInterval to config.increment

-

should create tokenBuckets

-

should call destroy() on each key in tokenBuckets

-

should null out the objects

-

should call TokenBucket if the key is new

-

should not call TokenBucket if the key already exists

-

should call decrementTokens on TokenBucket instance

-

should call decrementTokens with an amount if given one

-

should error if nothing is given

-

should not error on valid key

-

should error on int

-

should error on function

-

should error on object

-

should clean up tokenBuckets every incrementInterval

-

should not clean up tokenBuckets that are active

-

should call TokenBucket if the key is new

-

should not call TokenBucket if the key already exists

-

should call getTokensRemaining on TokenBucket instance

-

should error if no key is given

-

should do nothing if a key is given

-

should error on int

-

should error on function

-

should error on object

-

should not error if not given a config

-

should return an object

-

should create maxLimit

-

should create limit

-

should create a increment

-

should set up an interval calling _incrementTokens

-

should return an object

-

should create maxLimit

-

should create limit

-

should create a increment

-

should set up an interval calling _incrementTokens

-

should clear the interval

-

should destroy the interval

-

should increment tokens if not at limit

-

should not increment tokens past limit

-

should not increment tokens past limit by addition

-

should gain config.increment tokens at the end of the config.incrementInterval

-

should decrement tokens when enough tokens are available

-

should throw error if tokens are less than the decrement amount

-

should take an amount and decrement that given amount of tokens

-

should return the tokens remaining

-