From 8fee77b04b4804acda1ad44a2857ba4239984d7f Mon Sep 17 00:00:00 2001 From: Smeb Date: Mon, 27 Nov 2023 13:53:26 +0100 Subject: [PATCH] fix #1579: add test to check getCacheVersion does not mutate arguments --- packages/cache/__tests__/cacheHttpClient.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/cache/__tests__/cacheHttpClient.test.ts b/packages/cache/__tests__/cacheHttpClient.test.ts index 02dd91c1..21c5ae86 100644 --- a/packages/cache/__tests__/cacheHttpClient.test.ts +++ b/packages/cache/__tests__/cacheHttpClient.test.ts @@ -5,6 +5,12 @@ import {DownloadOptions, getDownloadOptions} from '../src/options' jest.mock('../src/internal/downloadUtils') +test('getCacheVersion does not mutate arguments', async () => { + const paths = ['node_modules'] + getCacheVersion(paths, undefined, true) + expect(paths).toEqual(['node_modules']) +}) + test('getCacheVersion with one path returns version', async () => { const paths = ['node_modules'] const result = getCacheVersion(paths, undefined, true)