mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-03 15:23:15 +08:00
Initial commit to create @actions/cache package
This commit is contained in:
28
packages/cache/__tests__/cacheHttpClient.test.ts
vendored
Normal file
28
packages/cache/__tests__/cacheHttpClient.test.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import {getCacheVersion} from '../src/internal/cacheHttpClient'
|
||||
import {CompressionMethod} from '../src/internal/constants'
|
||||
|
||||
test('getCacheVersion with path input and compression method undefined returns version', async () => {
|
||||
const inputPath = 'node_modules'
|
||||
const result = getCacheVersion(inputPath)
|
||||
expect(result).toEqual(
|
||||
'b3e0c6cb5ecf32614eeb2997d905b9c297046d7cbf69062698f25b14b4cb0985'
|
||||
)
|
||||
})
|
||||
|
||||
test('getCacheVersion with zstd compression returns version', async () => {
|
||||
const inputPath = 'node_modules'
|
||||
const result = getCacheVersion(inputPath, CompressionMethod.Zstd)
|
||||
|
||||
expect(result).toEqual(
|
||||
'273877e14fd65d270b87a198edbfa2db5a43de567c9a548d2a2505b408befe24'
|
||||
)
|
||||
})
|
||||
|
||||
test('getCacheVersion with gzip compression does not change vesion', async () => {
|
||||
const inputPath = 'node_modules'
|
||||
const result = getCacheVersion(inputPath, CompressionMethod.Gzip)
|
||||
|
||||
expect(result).toEqual(
|
||||
'b3e0c6cb5ecf32614eeb2997d905b9c297046d7cbf69062698f25b14b4cb0985'
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user