Skip to content

Commit

Permalink
Merge pull request #1683 from Smeb/fix-1579
Browse files Browse the repository at this point in the history
fix #1579: add test to check getCacheVersion does not mutate arguments
  • Loading branch information
bethanyj28 committed Mar 7, 2024
2 parents b807fc9 + 8fee77b commit ef77c9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/cache/__tests__/cacheHttpClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ef77c9d

Please sign in to comment.