mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +00:00
fix tests
This commit is contained in:
parent
ca41e9d2b6
commit
bd01c0d9fb
1 changed files with 6 additions and 1 deletions
|
@ -37,6 +37,7 @@ describe('Finder tests', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
jest.resetAllMocks();
|
jest.resetAllMocks();
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
|
jest.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Finds Python if it is installed', async () => {
|
it('Finds Python if it is installed', async () => {
|
||||||
|
@ -127,7 +128,7 @@ describe('Finder tests', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
await io.mkdirP(pythonDir);
|
await io.mkdirP(pythonDir);
|
||||||
await io.rmRF(expPath);
|
await io.rmRF(path.join(toolDir, 'Python', '1.2.3'));
|
||||||
|
|
||||||
fs.writeFileSync(`${pythonDir}.complete`, 'hello');
|
fs.writeFileSync(`${pythonDir}.complete`, 'hello');
|
||||||
// This will throw if it doesn't find it in the cache and in the manifest (because no such version exists)
|
// This will throw if it doesn't find it in the cache and in the manifest (because no such version exists)
|
||||||
|
@ -137,6 +138,10 @@ describe('Finder tests', () => {
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
expect(infoSpy).toHaveBeenCalledWith(
|
||||||
'Version 1.2.3 was not found in the local cache'
|
'Version 1.2.3 was not found in the local cache'
|
||||||
);
|
);
|
||||||
|
expect(infoSpy).toBeCalledWith(
|
||||||
|
'Version 1.2.3 is available for downloading'
|
||||||
|
);
|
||||||
|
expect(installSpy).toHaveBeenCalled();
|
||||||
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${os.EOL}`);
|
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${os.EOL}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue