mirror of
https://github.com/actions/toolkit.git
synced 2026-08-13 00:00:44 +02:00
test: fix deprecated Jest matchers for v30
- Replace toThrowError() with toThrow() - Replace toBeCalledWith() with toHaveBeenCalledWith() - Update snapshots
This commit is contained in:
+2
-2
@@ -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.`
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user