From a743c858bf7a81abafe441a3981da2a80d465896 Mon Sep 17 00:00:00 2001 From: panticmilos Date: Mon, 18 Jul 2022 16:00:00 +0200 Subject: [PATCH] Hide mock implementation --- __tests__/cache-restore.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/__tests__/cache-restore.test.ts b/__tests__/cache-restore.test.ts index b2c5e6b6..79e04761 100644 --- a/__tests__/cache-restore.test.ts +++ b/__tests__/cache-restore.test.ts @@ -114,18 +114,17 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py dependencyFile ); - computeKeysSpy.mockImplementation(() => Promise.resolve('Ubuntu-20.4')); - if (process.env['RUNNER_OS']?.toLowerCase() === 'linux') { + computeKeysSpy.mockImplementation(() => Promise.resolve('Ubuntu-20.4')); Object.defineProperty(utils, 'IS_LINUX', { value: () => { - jest.fn().mockReturnValue(true); + jest.fn().mockImplementation(() => true); } }); } else { Object.defineProperty(utils, 'IS_LINUX', { value: () => { - jest.fn().mockReturnValue(false); + jest.fn().mockReturnValue(() => false); } }); }