From 30fcc527a52148e9910589532f4a9cf3c772a645 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 4 Apr 2023 14:43:20 +0200 Subject: [PATCH] add mock for tests --- __tests__/cache-restore.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/__tests__/cache-restore.test.ts b/__tests__/cache-restore.test.ts index 81499903..b4b48ad2 100644 --- a/__tests__/cache-restore.test.ts +++ b/__tests__/cache-restore.test.ts @@ -163,6 +163,12 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py fileHash, cachePaths ) => { + restoreCacheSpy.mockImplementation( + (cachePaths: string[], primaryKey: string, restoreKey?: string) => { + return primaryKey.includes(fileHash) ? primaryKey : ''; + } + ); + const cacheDistributor = getCacheDistributor( packageManager, pythonVersion,