1
0
Fork 0

Merge pull request #1683 from Smeb/fix-1579

fix #1579: add test to check getCacheVersion does not mutate arguments
pull/1685/head
Bethany 2024-03-07 10:48:45 -05:00 committed by GitHub
commit ef77c9d60b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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)