Functional Test Report

Start: 2018-12-19 18:31:00
43 tests -- 43 passed / 0 failed / 0 pending
E:\work\node\lru-cache\src\test\LruCache.test.js
1.405s
LruCacheshould provide a 'set' method for a key/value pair and a 'get' method to retrieve by keypassed in 0.004s
LruCacheshould allow to pass an array of alternate keys to 'set' method. 'get' and 'has' must also work with the alternate keypassed in 0.002s
LruCacheshould provide a 'setAsync' method that also supports alternate keyspassed in 0.008s
LruCacheshould provide a 'setAll' method that supports alternateKeys and allow for alternateKeys to be a string instead of an arraypassed in 0.001s
LruCacheshould throw when no array is passed to 'setAll'passed in 0s
LruCacheshould provide a 'setAllAsync' methodpassed in 0.001s
LruCacheshould throw when trying to use an alternate key that is already used for another keypassed in 0s
LruCacheshould provide a 'setMaxSize' and 'getMaxSize' method and should use max size infinite, if null or 0 is passed to 'setMaxSize'passed in 0.001s
LruCacheshould provide a 'getSize' methodpassed in 0s
LruCacheshould provide a 'delete' method that works with key, but not with alternate keypassed in 0.002s
LruCacheshould provide a 'getValueType' methodpassed in 0s
LruCacheshould provide a 'getEntries' methodpassed in 0s
LruCacheshould provide a 'forEach' method that iterates from oldest to newest entrypassed in 0.001s
LruCacheshould provide a method to define an entry getter that is used in case of a cache misspassed in 0s
LruCacheshould provide a method to define an async entry getter that is used in case of a cache misspassed in 0.203s
LruCacheshould handle the case where a getter returns undefinedpassed in 0.412s
LruCacheshould take the value from the entry getter and not from the cache, if specified in getpassed in 0s
LruCacheshould throw, if value should be taken from entry getter and no entry getter is definedpassed in 0.001s
LruCacheshould be possible to override a set entry getter by passing a custom one to the get methodpassed in 0.001s
getCacheshould return the same LruCache instance for the same value type (LruCache must be a per-valueType-singleton)passed in 0s
clearAllCachesshould clear all cachespassed in 0.002s
registerCacheChangedHandlershould register a listener to cache change events and return a handlerHandle to activate/deactivate or unregister the listenerpassed in 0.002s
registerCacheChangedHandlershould call a listener only once in case of setAllpassed in 0.001s
registerCacheChangedHandlershould create correct change events for setpassed in 0.003s
registerCacheChangedHandlershould throw an error in case of throwing change handlers, but still keep the cache consistentpassed in 0.001s
registerCacheChangedHandlershould create correct change events for deletepassed in 0.001s
registerCacheChangedHandlershould create correct change events for clearpassed in 0s
registerCacheChangedHandlershould create correct change events for LRU removespassed in 0.002s
registerCacheChangedHandlershould create correct change events if setMaxSize leads to LRU removespassed in 0.001s
registerCacheChangedHandlershould only listen to events of the given value typespassed in 0s
cacheTransactionshould batch change events inside a cache transaction into a single change event being dispatchedpassed in 0.002s
cacheTransactionshould handle a promise instead of a callbackpassed in 0.013s
E:\work\node\lru-cache\src\test\LruMap.test.js
0.087s
LruMapshould take maxSize as constructor argument and should provide getMaxSize methodpassed in 0.001s
LruMapshould provide set, get and has methods like a Mappassed in 0.001s
LruMapshould let the set method return the removed entry in case maxSize was exceeded, else nullpassed in 0.001s
LruMapshould provide a getSize methodpassed in 0.001s
LruMapshould provide a delete method that returns false in case the to be deleted key was not in the mappassed in 0s
LruMapshould provide a setMaxSize method that returns an array of removed entries in case the newMaxSize is smaller than map sizepassed in 0s
LruMapshould set maxSize to null (meaning infinite) in case 0 is provided as argumentpassed in 0.001s
LruMapshould provide a forEach method like a Mappassed in 0s
LruMapshould provide a map methodpassed in 0.001s
LruMapshould provide a clear method that returns an array of removed entriespassed in 0s
LruMapshould provide correct LRU logicpassed in 0.002s