Skip to content

Commit 8fee77b

Browse files
committed
fix actions#1579: add test to check getCacheVersion does not mutate arguments
1 parent b807fc9 commit 8fee77b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/cache/__tests__/cacheHttpClient.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import {DownloadOptions, getDownloadOptions} from '../src/options'
55

66
jest.mock('../src/internal/downloadUtils')
77

8+
test('getCacheVersion does not mutate arguments', async () => {
9+
const paths = ['node_modules']
10+
getCacheVersion(paths, undefined, true)
11+
expect(paths).toEqual(['node_modules'])
12+
})
13+
814
test('getCacheVersion with one path returns version', async () => {
915
const paths = ['node_modules']
1016
const result = getCacheVersion(paths, undefined, true)

0 commit comments

Comments
 (0)