mirror of
https://github.com/actions/toolkit.git
synced 2026-08-07 00:00:18 +02:00
* feat(cache): surface cache read-denied as a distinct restore warning Mirror the existing cache write-denied handling on the restore path. When the receiver refuses a download URL because the run's token has no readable cache scopes, it returns a twirp PermissionDenied (HTTP 403). The twirp client wraps that 403 in a generic Error, so the stable 'cache read denied:' prefix is embedded in the message rather than at the start. - Add CACHE_READ_DENIED_PREFIX and CacheReadDeniedError - Dispatch on the prefix in the restoreCacheV2 catch block (V2 only), log a policy-specific warning, and report a cache miss so the run continues - Add a test mirroring the write-denied coverage * chore(cache): trim comments, bump to 6.2.0, add RELEASES entry * refactor(cache): dispatch read-denied by error name to mirror write path Re-throw CacheReadDeniedError from an inner try/catch around GetCacheEntryDownloadURL and dispatch on typedError.name in the outer catch, matching how saveCacheV2 handles CacheWriteDeniedError. * feat(cache): handle read-denied on the v1 restore path Extend the read-denied handling to Cache Service v1 so GHES (which forces v1 via _apis/artifactcache) is covered when read-scope enforcement ships there. - Surface the receiver's error body message from getCacheEntry instead of a generic status-code error, so the cache read denied: prefix reaches callers - Re-throw CacheReadDeniedError from restoreCacheV1 and dispatch on it in the outer catch, mirroring restoreCacheV2 and the write-denied v1 handling - Add a v1 read-denied test * refactor(cache): only surface receiver body for read-denied on v1 * test(cache): assert getCacheEntry only surfaces body for read-denied * test(cache): cover non-read-denied getCacheEntry passthrough on v1 * refactor(cache): share read-denied prefix via constants to avoid drift * feat(cache): skip restore/save per ACTIONS_CACHE_MODE * test(cache): expand ACTIONS_CACHE_MODE skip coverage across v1/v2 and unknown modes * fix copilot pr feedback Co-authored-by: Copilot Autofix powered by AI <[email protected]> * docs(cache): remove internal reference from cache-mode comment * test(cache): merge redundant cache-mode skip tests and simplify read-denied handling Address PR review feedback: - Merge the duplicate restore/save skip test.each blocks into single blocks parametrized over ACTIONS_CACHE_SERVICE_V2. - Drop the redundant CacheReadDeniedError catch arms; the typed error is not an HttpClientError so it already falls through to a non-fatal warning. - Clarify why read-denied classification happens both in getCacheEntry and cache.ts (dependency-free internal module cannot import the typed error). * refactor(cache): drop redundant CacheWriteDeniedError catch arms Mirror the read-denied simplification on the save path. CacheWriteDeniedError is not an HttpClientError and its name does not match the ReserveCacheError arm, so it falls through to the same non-fatal warning. Logging behavior is unchanged (warns, never fails the run) and the exported type is still thrown internally for consumers and tests. Also refresh stale doc wording. * test(cache): collapse redundant restore getCacheEntry-failure tests The two restoreCache tests exercised the identical warning + cache-miss path now that read-denied is no longer reclassified in the catch, so merge them into one. The read-denied prefix detection that actually branches on the message is covered by getCacheEntry tests in cacheHttpClient.test.ts. --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]>
467 lines
15 KiB
TypeScript
467 lines
15 KiB
TypeScript
import * as core from '@actions/core'
|
|
import * as path from 'path'
|
|
import * as tar from '../src/internal/tar'
|
|
import * as config from '../src/internal/config'
|
|
import * as cacheUtils from '../src/internal/cacheUtils'
|
|
import * as cacheHttpClient from '../src/internal/cacheHttpClient'
|
|
import {restoreCache} from '../src/cache'
|
|
import {CacheFilename, CompressionMethod} from '../src/internal/constants'
|
|
import {CacheServiceClientJSON} from '../src/generated/results/api/v1/cache.twirp-client'
|
|
import {DownloadOptions} from '../src/options'
|
|
import {HttpClientError} from '@actions/http-client'
|
|
|
|
jest.mock('../src/internal/cacheHttpClient')
|
|
jest.mock('../src/internal/cacheUtils')
|
|
jest.mock('../src/internal/config')
|
|
jest.mock('../src/internal/tar')
|
|
|
|
let logDebugMock: jest.SpyInstance
|
|
let logInfoMock: jest.SpyInstance
|
|
|
|
beforeAll(() => {
|
|
jest.spyOn(console, 'log').mockImplementation(() => {})
|
|
jest.spyOn(core, 'debug').mockImplementation(() => {})
|
|
jest.spyOn(core, 'info').mockImplementation(() => {})
|
|
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
|
jest.spyOn(core, 'error').mockImplementation(() => {})
|
|
|
|
jest.spyOn(cacheUtils, 'getCacheFileName').mockImplementation(cm => {
|
|
const actualUtils = jest.requireActual('../src/internal/cacheUtils')
|
|
return actualUtils.getCacheFileName(cm)
|
|
})
|
|
|
|
// Ensure that we're using v2 for these tests
|
|
jest.spyOn(config, 'getCacheServiceVersion').mockReturnValue('v2')
|
|
|
|
// config is auto-mocked; use the real cache-mode helpers so gating reflects
|
|
// ACTIONS_CACHE_MODE and unset stays permissive.
|
|
const actualConfig = jest.requireActual('../src/internal/config')
|
|
jest
|
|
.spyOn(config, 'getCacheMode')
|
|
.mockImplementation(actualConfig.getCacheMode)
|
|
jest
|
|
.spyOn(config, 'isCacheReadable')
|
|
.mockImplementation(actualConfig.isCacheReadable)
|
|
jest
|
|
.spyOn(config, 'isCacheWritable')
|
|
.mockImplementation(actualConfig.isCacheWritable)
|
|
|
|
logDebugMock = jest.spyOn(core, 'debug')
|
|
logInfoMock = jest.spyOn(core, 'info')
|
|
})
|
|
|
|
afterEach(() => {
|
|
expect(logDebugMock).toHaveBeenCalledWith('Cache service version: v2')
|
|
})
|
|
|
|
test('restore with no path should fail', async () => {
|
|
const paths: string[] = []
|
|
const key = 'node-test'
|
|
await expect(restoreCache(paths, key)).rejects.toThrowError(
|
|
`Path Validation Error: At least one directory or file path is required`
|
|
)
|
|
})
|
|
|
|
test('restore with too many keys should fail', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
const restoreKeys = [...Array(20).keys()].map(x => x.toString())
|
|
await expect(restoreCache(paths, key, restoreKeys)).rejects.toThrowError(
|
|
`Key Validation Error: Keys are limited to a maximum of 10.`
|
|
)
|
|
})
|
|
|
|
test('restore with large key should fail', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'foo'.repeat(512) // Over the 512 character limit
|
|
await expect(restoreCache(paths, key)).rejects.toThrowError(
|
|
`Key Validation Error: ${key} cannot be larger than 512 characters.`
|
|
)
|
|
})
|
|
|
|
test('restore with invalid key should fail', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'comma,comma'
|
|
await expect(restoreCache(paths, key)).rejects.toThrowError(
|
|
`Key Validation Error: ${key} cannot contain commas.`
|
|
)
|
|
})
|
|
|
|
test('restore with no cache found', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
|
|
jest
|
|
.spyOn(CacheServiceClientJSON.prototype, 'GetCacheEntryDownloadURL')
|
|
.mockReturnValue(
|
|
Promise.resolve({
|
|
ok: false,
|
|
signedDownloadUrl: '',
|
|
matchedKey: ''
|
|
})
|
|
)
|
|
|
|
const cacheKey = await restoreCache(paths, key)
|
|
|
|
expect(cacheKey).toBe(undefined)
|
|
})
|
|
|
|
test('restore with server error should fail', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
const logErrorMock = jest.spyOn(core, 'error')
|
|
|
|
jest
|
|
.spyOn(CacheServiceClientJSON.prototype, 'GetCacheEntryDownloadURL')
|
|
.mockImplementation(() => {
|
|
throw new HttpClientError('HTTP Error Occurred', 500)
|
|
})
|
|
|
|
const cacheKey = await restoreCache(paths, key)
|
|
expect(cacheKey).toBe(undefined)
|
|
expect(logErrorMock).toHaveBeenCalledTimes(1)
|
|
expect(logErrorMock).toHaveBeenCalledWith(
|
|
'Failed to restore: HTTP Error Occurred'
|
|
)
|
|
})
|
|
|
|
test('restore denied by read-only token logs warning and reports cache miss', async () => {
|
|
// The receiver returns twirp PermissionDenied (403) when the run's token has
|
|
// no readable cache scopes; the client wraps it so the `cache read denied:`
|
|
// prefix arrives embedded. Expect a single warning (not error) and a miss.
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
const logErrorMock = jest.spyOn(core, 'error')
|
|
const logWarningMock = jest.spyOn(core, 'warning')
|
|
const wrappedDeniedMessage =
|
|
'Failed to GetCacheEntryDownloadURL: Received non-retryable error: ' +
|
|
'Failed request: (403) Forbidden: cache read denied: token has no readable scopes'
|
|
|
|
jest
|
|
.spyOn(CacheServiceClientJSON.prototype, 'GetCacheEntryDownloadURL')
|
|
.mockImplementation(() => {
|
|
throw new Error(wrappedDeniedMessage)
|
|
})
|
|
|
|
const cacheKey = await restoreCache(paths, key)
|
|
expect(cacheKey).toBe(undefined)
|
|
expect(logErrorMock).not.toHaveBeenCalled()
|
|
expect(logWarningMock).toHaveBeenCalledWith(
|
|
`Failed to restore: ${wrappedDeniedMessage}`
|
|
)
|
|
expect(logWarningMock).toHaveBeenCalledTimes(1)
|
|
})
|
|
|
|
test('restore with restore keys and no cache found', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
const restoreKeys = ['node-']
|
|
const cacheVersion =
|
|
'd90f107aaeb22920dba0c637a23c37b5bc497b4dfa3b07fe3f79bf88a273c11b'
|
|
const getCacheVersionMock = jest.spyOn(cacheUtils, 'getCacheVersion')
|
|
getCacheVersionMock.mockReturnValue(cacheVersion)
|
|
|
|
jest
|
|
.spyOn(CacheServiceClientJSON.prototype, 'GetCacheEntryDownloadURL')
|
|
.mockReturnValue(
|
|
Promise.resolve({
|
|
ok: false,
|
|
signedDownloadUrl: '',
|
|
matchedKey: ''
|
|
})
|
|
)
|
|
|
|
const cacheKey = await restoreCache(paths, key, restoreKeys)
|
|
|
|
expect(cacheKey).toBe(undefined)
|
|
expect(logDebugMock).toHaveBeenCalledWith(
|
|
`Cache not found for version ${cacheVersion} of keys: ${[
|
|
key,
|
|
...restoreKeys
|
|
].join(', ')}`
|
|
)
|
|
})
|
|
|
|
test('restore with gzip compressed cache found', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
const compressionMethod = CompressionMethod.Gzip
|
|
const signedDownloadUrl = 'https://blob-storage.local?signed=true'
|
|
const cacheVersion =
|
|
'd90f107aaeb22920dba0c637a23c37b5bc497b4dfa3b07fe3f79bf88a273c11b'
|
|
const options = {useAzureSdk: true} as DownloadOptions
|
|
|
|
const getCacheVersionMock = jest.spyOn(cacheUtils, 'getCacheVersion')
|
|
getCacheVersionMock.mockReturnValue(cacheVersion)
|
|
|
|
const compressionMethodMock = jest.spyOn(cacheUtils, 'getCompressionMethod')
|
|
compressionMethodMock.mockReturnValue(Promise.resolve(compressionMethod))
|
|
|
|
const getCacheDownloadURLMock = jest.spyOn(
|
|
CacheServiceClientJSON.prototype,
|
|
'GetCacheEntryDownloadURL'
|
|
)
|
|
getCacheDownloadURLMock.mockReturnValue(
|
|
Promise.resolve({
|
|
ok: true,
|
|
signedDownloadUrl,
|
|
matchedKey: key
|
|
})
|
|
)
|
|
|
|
const tempPath = '/foo/bar'
|
|
|
|
const createTempDirectoryMock = jest.spyOn(cacheUtils, 'createTempDirectory')
|
|
createTempDirectoryMock.mockImplementation(async () => {
|
|
return Promise.resolve(tempPath)
|
|
})
|
|
|
|
const archivePath = path.join(tempPath, CacheFilename.Gzip)
|
|
const downloadCacheMock = jest.spyOn(cacheHttpClient, 'downloadCache')
|
|
|
|
const fileSize = 142
|
|
const getArchiveFileSizeInBytesMock = jest
|
|
.spyOn(cacheUtils, 'getArchiveFileSizeInBytes')
|
|
.mockReturnValue(fileSize)
|
|
|
|
const extractTarMock = jest.spyOn(tar, 'extractTar')
|
|
const unlinkFileMock = jest.spyOn(cacheUtils, 'unlinkFile')
|
|
|
|
const cacheKey = await restoreCache(paths, key, [], options)
|
|
|
|
expect(cacheKey).toBe(key)
|
|
expect(getCacheVersionMock).toHaveBeenCalledWith(
|
|
paths,
|
|
compressionMethod,
|
|
false
|
|
)
|
|
expect(getCacheDownloadURLMock).toHaveBeenCalledWith({
|
|
key,
|
|
restoreKeys: [],
|
|
version: cacheVersion
|
|
})
|
|
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1)
|
|
expect(downloadCacheMock).toHaveBeenCalledWith(
|
|
signedDownloadUrl,
|
|
archivePath,
|
|
options
|
|
)
|
|
expect(getArchiveFileSizeInBytesMock).toHaveBeenCalledWith(archivePath)
|
|
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`)
|
|
|
|
expect(extractTarMock).toHaveBeenCalledTimes(1)
|
|
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
|
|
|
|
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
|
|
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
|
|
|
|
expect(compressionMethodMock).toHaveBeenCalledTimes(1)
|
|
})
|
|
|
|
test('restore with zstd compressed cache found', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
const compressionMethod = CompressionMethod.Zstd
|
|
const signedDownloadUrl = 'https://blob-storage.local?signed=true'
|
|
const cacheVersion =
|
|
'8e2e96a184cb0cd6b48285b176c06a418f3d7fce14c29d9886fd1bb4f05c513d'
|
|
const options = {useAzureSdk: true} as DownloadOptions
|
|
|
|
const getCacheVersionMock = jest.spyOn(cacheUtils, 'getCacheVersion')
|
|
getCacheVersionMock.mockReturnValue(cacheVersion)
|
|
|
|
const compressionMethodMock = jest.spyOn(cacheUtils, 'getCompressionMethod')
|
|
compressionMethodMock.mockReturnValue(Promise.resolve(compressionMethod))
|
|
|
|
const getCacheDownloadURLMock = jest.spyOn(
|
|
CacheServiceClientJSON.prototype,
|
|
'GetCacheEntryDownloadURL'
|
|
)
|
|
getCacheDownloadURLMock.mockReturnValue(
|
|
Promise.resolve({
|
|
ok: true,
|
|
signedDownloadUrl,
|
|
matchedKey: key
|
|
})
|
|
)
|
|
|
|
const tempPath = '/foo/bar'
|
|
|
|
const createTempDirectoryMock = jest.spyOn(cacheUtils, 'createTempDirectory')
|
|
createTempDirectoryMock.mockImplementation(async () => {
|
|
return Promise.resolve(tempPath)
|
|
})
|
|
|
|
const archivePath = path.join(tempPath, CacheFilename.Zstd)
|
|
const downloadCacheMock = jest.spyOn(cacheHttpClient, 'downloadCache')
|
|
|
|
const fileSize = 62915000
|
|
const getArchiveFileSizeInBytesMock = jest
|
|
.spyOn(cacheUtils, 'getArchiveFileSizeInBytes')
|
|
.mockReturnValue(fileSize)
|
|
|
|
const extractTarMock = jest.spyOn(tar, 'extractTar')
|
|
const unlinkFileMock = jest.spyOn(cacheUtils, 'unlinkFile')
|
|
|
|
const cacheKey = await restoreCache(paths, key, [], options)
|
|
|
|
expect(cacheKey).toBe(key)
|
|
expect(logInfoMock).toHaveBeenCalledWith(`Cache hit for: ${key}`)
|
|
expect(getCacheVersionMock).toHaveBeenCalledWith(
|
|
paths,
|
|
compressionMethod,
|
|
false
|
|
)
|
|
expect(getCacheDownloadURLMock).toHaveBeenCalledWith({
|
|
key,
|
|
restoreKeys: [],
|
|
version: cacheVersion
|
|
})
|
|
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1)
|
|
expect(downloadCacheMock).toHaveBeenCalledWith(
|
|
signedDownloadUrl,
|
|
archivePath,
|
|
options
|
|
)
|
|
expect(getArchiveFileSizeInBytesMock).toHaveBeenCalledWith(archivePath)
|
|
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~60 MB (62915000 B)`)
|
|
|
|
expect(extractTarMock).toHaveBeenCalledTimes(1)
|
|
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
|
|
|
|
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
|
|
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
|
|
|
|
expect(compressionMethodMock).toHaveBeenCalledTimes(1)
|
|
})
|
|
|
|
test('restore with cache found for restore key', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
const restoreKeys = ['node-']
|
|
const compressionMethod = CompressionMethod.Gzip
|
|
const signedDownloadUrl = 'https://blob-storage.local?signed=true'
|
|
const cacheVersion =
|
|
'b8b58e9bd7b1e8f83d9f05c7e06ea865ba44a0330e07a14db74ac74386677bed'
|
|
const options = {useAzureSdk: true} as DownloadOptions
|
|
|
|
const getCacheVersionMock = jest.spyOn(cacheUtils, 'getCacheVersion')
|
|
getCacheVersionMock.mockReturnValue(cacheVersion)
|
|
|
|
const compressionMethodMock = jest.spyOn(cacheUtils, 'getCompressionMethod')
|
|
compressionMethodMock.mockReturnValue(Promise.resolve(compressionMethod))
|
|
|
|
const getCacheDownloadURLMock = jest.spyOn(
|
|
CacheServiceClientJSON.prototype,
|
|
'GetCacheEntryDownloadURL'
|
|
)
|
|
getCacheDownloadURLMock.mockReturnValue(
|
|
Promise.resolve({
|
|
ok: true,
|
|
signedDownloadUrl,
|
|
matchedKey: restoreKeys[0]
|
|
})
|
|
)
|
|
|
|
const tempPath = '/foo/bar'
|
|
|
|
const createTempDirectoryMock = jest.spyOn(cacheUtils, 'createTempDirectory')
|
|
createTempDirectoryMock.mockImplementation(async () => {
|
|
return Promise.resolve(tempPath)
|
|
})
|
|
|
|
const archivePath = path.join(tempPath, CacheFilename.Gzip)
|
|
const downloadCacheMock = jest.spyOn(cacheHttpClient, 'downloadCache')
|
|
|
|
const fileSize = 142
|
|
const getArchiveFileSizeInBytesMock = jest
|
|
.spyOn(cacheUtils, 'getArchiveFileSizeInBytes')
|
|
.mockReturnValue(fileSize)
|
|
|
|
const extractTarMock = jest.spyOn(tar, 'extractTar')
|
|
const unlinkFileMock = jest.spyOn(cacheUtils, 'unlinkFile')
|
|
|
|
const cacheKey = await restoreCache(paths, key, restoreKeys, options)
|
|
|
|
expect(cacheKey).toBe(restoreKeys[0])
|
|
expect(logInfoMock).toHaveBeenCalledWith(
|
|
`Cache hit for restore-key: ${restoreKeys[0]}`
|
|
)
|
|
expect(getCacheVersionMock).toHaveBeenCalledWith(
|
|
paths,
|
|
compressionMethod,
|
|
false
|
|
)
|
|
expect(getCacheDownloadURLMock).toHaveBeenCalledWith({
|
|
key,
|
|
restoreKeys,
|
|
version: cacheVersion
|
|
})
|
|
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1)
|
|
expect(downloadCacheMock).toHaveBeenCalledWith(
|
|
signedDownloadUrl,
|
|
archivePath,
|
|
options
|
|
)
|
|
expect(getArchiveFileSizeInBytesMock).toHaveBeenCalledWith(archivePath)
|
|
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`)
|
|
|
|
expect(extractTarMock).toHaveBeenCalledTimes(1)
|
|
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
|
|
|
|
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
|
|
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
|
|
|
|
expect(compressionMethodMock).toHaveBeenCalledTimes(1)
|
|
})
|
|
|
|
test('restore with lookup only enabled', async () => {
|
|
const paths = ['node_modules']
|
|
const key = 'node-test'
|
|
const compressionMethod = CompressionMethod.Gzip
|
|
const signedDownloadUrl = 'https://blob-storage.local?signed=true'
|
|
const cacheVersion =
|
|
'd90f107aaeb22920dba0c637a23c37b5bc497b4dfa3b07fe3f79bf88a273c11b'
|
|
const options = {lookupOnly: true, useAzureSdk: true} as DownloadOptions
|
|
|
|
const getCacheVersionMock = jest.spyOn(cacheUtils, 'getCacheVersion')
|
|
getCacheVersionMock.mockReturnValue(cacheVersion)
|
|
|
|
const compressionMethodMock = jest.spyOn(cacheUtils, 'getCompressionMethod')
|
|
compressionMethodMock.mockReturnValue(Promise.resolve(compressionMethod))
|
|
|
|
const getCacheDownloadURLMock = jest.spyOn(
|
|
CacheServiceClientJSON.prototype,
|
|
'GetCacheEntryDownloadURL'
|
|
)
|
|
getCacheDownloadURLMock.mockReturnValue(
|
|
Promise.resolve({
|
|
ok: true,
|
|
signedDownloadUrl,
|
|
matchedKey: key
|
|
})
|
|
)
|
|
|
|
const createTempDirectoryMock = jest.spyOn(cacheUtils, 'createTempDirectory')
|
|
const downloadCacheMock = jest.spyOn(cacheHttpClient, 'downloadCache')
|
|
|
|
const cacheKey = await restoreCache(paths, key, undefined, options)
|
|
|
|
expect(cacheKey).toBe(key)
|
|
expect(getCacheVersionMock).toHaveBeenCalledWith(
|
|
paths,
|
|
compressionMethod,
|
|
false
|
|
)
|
|
expect(getCacheDownloadURLMock).toHaveBeenCalledWith({
|
|
key,
|
|
restoreKeys: [],
|
|
version: cacheVersion
|
|
})
|
|
expect(logInfoMock).toHaveBeenCalledWith('Lookup only - skipping download')
|
|
|
|
// creating a tempDir and downloading the cache are skipped
|
|
expect(createTempDirectoryMock).toHaveBeenCalledTimes(0)
|
|
expect(downloadCacheMock).toHaveBeenCalledTimes(0)
|
|
})
|