|  | 
| 1 | 1 | import * as path from 'path' | 
| 2 | 2 | import {promises as fs} from 'fs' | 
| 3 | 3 | import * as exec from '@actions/exec' | 
|  | 4 | +import * as cache from '@actions/cache' | 
| 4 | 5 | import * as toolCache from '@actions/tool-cache' | 
| 5 | 6 | import {coerce as parseSemVer} from 'semver' | 
| 6 | 7 | import * as plist from 'plist' | 
| @@ -56,6 +57,8 @@ describe('macOS toolchain installation verification', () => { | 
| 56 | 57 | 
 | 
| 57 | 58 |     const download = path.resolve('tool', 'download', 'path') | 
| 58 | 59 |     jest.spyOn(installer, 'isInstallationNeeded').mockResolvedValue(true) | 
|  | 60 | +    jest.spyOn(cache, 'restoreCache').mockResolvedValue(undefined) | 
|  | 61 | +    jest.spyOn(cache, 'saveCache').mockResolvedValue(1) | 
| 59 | 62 |     jest.spyOn(toolCache, 'downloadTool').mockResolvedValue(download) | 
| 60 | 63 |     jest.spyOn(exec, 'exec').mockResolvedValue(0) | 
| 61 | 64 |     await expect(installer['download']()).resolves.toBe(download) | 
| @@ -95,6 +98,8 @@ describe('macOS toolchain installation verification', () => { | 
| 95 | 98 |     const swiftPath = path.join(cached, 'usr', 'bin') | 
| 96 | 99 |     const identifier = 'org.swift.581202305171a' | 
| 97 | 100 |     jest.spyOn(installer, 'isInstallationNeeded').mockResolvedValue(true) | 
|  | 101 | +    jest.spyOn(cache, 'restoreCache').mockResolvedValue(undefined) | 
|  | 102 | +    jest.spyOn(cache, 'saveCache').mockResolvedValue(1) | 
| 98 | 103 |     jest.spyOn(toolCache, 'find').mockReturnValue('') | 
| 99 | 104 |     jest.spyOn(exec, 'exec').mockResolvedValue(0) | 
| 100 | 105 |     const downloadSpy = jest.spyOn(toolCache, 'downloadTool') | 
|  | 
0 commit comments