Skip to content

Commit

Permalink
fix(): cache resolve version input
Browse files Browse the repository at this point in the history
  • Loading branch information
n33pm committed Oct 17, 2022
1 parent f556e5b commit 27d2bcb
Show file tree
Hide file tree
Showing 5 changed files with 1,330 additions and 2,048 deletions.
19 changes: 16 additions & 3 deletions __tests__/cache-restore.test.ts
Expand Up @@ -17,6 +17,7 @@ describe('restoreCache', () => {
let infoSpy = jest.spyOn(core, 'info');
let setOutputSpy = jest.spyOn(core, 'setOutput');

const versionSpec = '1.13.1';
const packageManager = 'default';
const cacheDependencyPath = 'path';

Expand All @@ -40,7 +41,11 @@ describe('restoreCache', () => {

//Act + Assert
expect(async () => {
await cacheRestore.restoreCache(packageManager, cacheDependencyPath);
await cacheRestore.restoreCache(
versionSpec,
packageManager,
cacheDependencyPath
);
}).rejects.toThrowError(
'Some specified paths were not resolved, unable to cache dependencies.'
);
Expand All @@ -61,7 +66,11 @@ describe('restoreCache', () => {
});

//Act + Assert
await cacheRestore.restoreCache(packageManager, cacheDependencyPath);
await cacheRestore.restoreCache(
versionSpec,
packageManager,
cacheDependencyPath
);
expect(infoSpy).toBeCalledWith(`Cache is not found`);
});

Expand All @@ -80,7 +89,11 @@ describe('restoreCache', () => {
});

//Act + Assert
await cacheRestore.restoreCache(packageManager, cacheDependencyPath);
await cacheRestore.restoreCache(
versionSpec,
packageManager,
cacheDependencyPath
);
expect(setOutputSpy).toBeCalledWith('cache-hit', true);
});
});

0 comments on commit 27d2bcb

Please sign in to comment.