test: fix deprecated Jest matchers for v30

- Replace toThrowError() with toThrow()
- Replace toBeCalledWith() with toHaveBeenCalledWith()
- Update snapshots
This commit is contained in:
Daniel Kennedy
2026-01-30 09:44:37 -05:00
parent 59d7acc324
commit f94d96c596
14 changed files with 44 additions and 44 deletions
+2 -2
View File
@@ -54,7 +54,7 @@ test('save with missing input should fail', async () => {
const paths: string[] = []
const key = 'Linux-node-bb828da54c148048dd17899ba9fda624811cfb43'
await expect(saveCache(paths, key)).rejects.toThrowError(
await expect(saveCache(paths, key)).rejects.toThrow(
`Path Validation Error: At least one directory or file path is required`
)
})
@@ -581,7 +581,7 @@ test('save with non existing path should not save cache using v2 saveCache', asy
jest.spyOn(cacheUtils, 'resolvePaths').mockImplementation(async () => {
return []
})
await expect(saveCache([path], key)).rejects.toThrowError(
await expect(saveCache([path], key)).rejects.toThrow(
`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`
)
})