This commit is contained in:
Pelle Wessman 2024-10-21 09:50:15 -07:00 committed by GitHub
commit b6a48a9949
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 40 additions and 17 deletions

View file

@ -132,13 +132,13 @@ describe('cache-restore', () => {
}
});
await restoreCache(packageManager, '');
await restoreCache(packageManager, '', '0');
expect(hashFilesSpy).toHaveBeenCalled();
expect(infoSpy).toHaveBeenCalledWith(
`Cache restored from key: node-cache-${platform}-${packageManager}-${fileHash}`
`Cache restored from key: ${platform}-0-setup-node-${packageManager}-${fileHash}`
);
expect(infoSpy).not.toHaveBeenCalledWith(
`${packageManager} cache is not found`
`Cache not found for input keys: ${platform}-0-setup-node-${packageManager}-${fileHash}, ${platform}-0-setup-node-${packageManager}-`
);
expect(setOutputSpy).toHaveBeenCalledWith('cache-hit', true);
}
@ -163,10 +163,10 @@ describe('cache-restore', () => {
});
restoreCacheSpy.mockImplementationOnce(() => undefined);
await restoreCache(packageManager, '');
await restoreCache(packageManager, '', '0');
expect(hashFilesSpy).toHaveBeenCalled();
expect(infoSpy).toHaveBeenCalledWith(
`${packageManager} cache is not found`
`Cache not found for input keys: ${platform}-0-setup-node-${packageManager}-${fileHash}, ${platform}-0-setup-node-${packageManager}-`
);
expect(setOutputSpy).toHaveBeenCalledWith('cache-hit', false);
}