From 422c071dabd1c49aa97cf073fd25773a61f2b530 Mon Sep 17 00:00:00 2001 From: dhvcc <1337kwiz@gmail.com> Date: Sun, 3 Apr 2022 01:42:29 +0300 Subject: [PATCH] Remove useless await in getCacheDistributor calls --- __tests__/cache-restore.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/__tests__/cache-restore.test.ts b/__tests__/cache-restore.test.ts index 4dce56a1..7b4dcf02 100644 --- a/__tests__/cache-restore.test.ts +++ b/__tests__/cache-restore.test.ts @@ -27,6 +27,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py let debugSpy: jest.SpyInstance; let saveSatetSpy: jest.SpyInstance; let getStateSpy: jest.SpyInstance; + let setOutputSpy: jest.SpyInstance; // cache spy let restoreCacheSpy: jest.SpyInstance; @@ -64,6 +65,9 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py return {stdout: '', stderr: 'Error occured', exitCode: 2}; }); + setOutputSpy = jest.spyOn(core, 'setOutput'); + setOutputSpy.mockImplementation(input => undefined); + restoreCacheSpy = jest.spyOn(cache, 'restoreCache'); restoreCacheSpy.mockImplementation( (cachePaths: string[], primaryKey: string, restoreKey?: string) => { @@ -100,7 +104,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py ])( 'restored dependencies for %s by primaryKey', async (packageManager, pythonVersion, dependencyFile, fileHash) => { - const cacheDistributor = await getCacheDistributor( + const cacheDistributor = getCacheDistributor( packageManager, pythonVersion, dependencyFile @@ -126,7 +130,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py dependencyFile, cacheDependencyPath ) => { - const cacheDistributor = await getCacheDistributor( + const cacheDistributor = getCacheDistributor( packageManager, pythonVersion, dependencyFile @@ -162,7 +166,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py return primaryKey !== fileHash && restoreKey ? pipFileLockHash : ''; } ); - const cacheDistributor = await getCacheDistributor( + const cacheDistributor = getCacheDistributor( packageManager, pythonVersion, dependencyFile