mirror of
https://github.com/actions/setup-python.git
synced 2025-07-01 15:13:46 +00:00
Added cache-hit output
This commit is contained in:
parent
422c071dab
commit
c933f3c50e
4 changed files with 50 additions and 0 deletions
|
@ -191,6 +191,37 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||
);
|
||||
});
|
||||
|
||||
describe('Check if handleMatchResult', () => {
|
||||
it.each([
|
||||
['pip', '3.8.12', 'requirements.txt', 'someKey', true],
|
||||
['pipenv', '3.9.1', 'requirements.txt', 'someKey', true],
|
||||
['poetry', '3.8.12', 'requirements.txt', 'someKey', true],
|
||||
['pip', '3.9.2', 'requirements.txt', undefined, false],
|
||||
['pipenv', '3.8.12', 'requirements.txt', undefined, false],
|
||||
['poetry', '3.9.12', 'requirements.txt', undefined, false]
|
||||
])(
|
||||
'sets correct outputs',
|
||||
async (
|
||||
packageManager,
|
||||
pythonVersion,
|
||||
dependencyFile,
|
||||
matchedKey,
|
||||
expectedOutputValue
|
||||
) => {
|
||||
const cacheDistributor = getCacheDistributor(
|
||||
packageManager,
|
||||
pythonVersion,
|
||||
dependencyFile
|
||||
);
|
||||
cacheDistributor.handleMatchResult(matchedKey);
|
||||
expect(setOutputSpy).toHaveBeenCalledWith(
|
||||
'cache-hit',
|
||||
expectedOutputValue
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue