1
0
Fork 0

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

pull/1683/head
Smeb 2023-11-27 13:53:26 +01:00
parent b807fc9c54
commit 8fee77b04b
1 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,12 @@ import {DownloadOptions, getDownloadOptions} from '../src/options'
jest.mock('../src/internal/downloadUtils') 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 () => { test('getCacheVersion with one path returns version', async () => {
const paths = ['node_modules'] const paths = ['node_modules']
const result = getCacheVersion(paths, undefined, true) const result = getCacheVersion(paths, undefined, true)