fix #1579: add test to check getCacheVersion does not mutate arguments

This commit is contained in:
Smeb committed 2024-03-07 16:23:04 +01:00
1 parent f6d9053379
commit 94d8025121
1 file changed
+6
+6
View File
@@ -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)