From 94d8025121e571c396fbef114a293fff2915e111 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 --- __tests__/cacheHttpClient.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/__tests__/cacheHttpClient.test.ts b/__tests__/cacheHttpClient.test.ts index 02dd91c..21c5ae8 100644 --- a/__tests__/cacheHttpClient.test.ts +++ b/__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)