Since this uses CacheFactory that keeps caches = {} in memory outside of angular, caches persist across unit tests using angular + angular-mocks + karma. This means every test suite that uses CacheFactory must destroy the cache after every spec, like this:
To make this simpler, the caches object can be reset when the root scope is destroyed, since that is only likely to happen in angular-mocks. Or there may be another method particular to angular-mocks that can be checked.
Since this uses CacheFactory that keeps
caches = {}
in memory outside of angular, caches persist across unit tests using angular + angular-mocks + karma. This means every test suite that usesCacheFactory
must destroy the cache after every spec, like this:To make this simpler, the caches object can be reset when the root scope is destroyed, since that is only likely to happen in angular-mocks. Or there may be another method particular to angular-mocks that can be checked.
Will submit a pull-request soon =)