From e7e259f3fe154b4e427d070db4ff7910de8d59f4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 27 Feb 2020 09:50:39 -0800 Subject: [PATCH] Make cache-manager tests strictNullChecks safe (#42686) The new code in cache-manager wasn't strictNullChecks safe, which caused problems because a community member enabled strictNullChecks in most packages during the review period for that code. This change just fixes the tests, although the optional methods on Store are a bit suspicious. From skimming cache-manager's documentation, I couldn't figure out if having the methods be optional was accurate. --- types/cache-manager/cache-manager-tests.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/cache-manager/cache-manager-tests.ts b/types/cache-manager/cache-manager-tests.ts index 827743de58..41a4723d8a 100644 --- a/types/cache-manager/cache-manager-tests.ts +++ b/types/cache-manager/cache-manager-tests.ts @@ -49,10 +49,11 @@ memoryCache.wrap<{ id: number, name: string }>(key, (cb: any) => { }); }); -memoryCache.store.keys().then((result) => { - - //console.log(result); -}); +if (memoryCache.store.keys) { + memoryCache.store.keys().then((result) => { + //console.log(result); + }); +} const multiCache = cacheManager.multiCaching([memoryCache]);