mirror of
https://github.com/actions/setup-go.git
synced 2025-04-24 18:02:15 +00:00
Adjust unit-tests for supporting new feature
This commit is contained in:
parent
661954d154
commit
c64d0e04b0
2 changed files with 6 additions and 6 deletions
|
@ -23,8 +23,8 @@ describe('restoreCache', () => {
|
|||
beforeEach(() => {
|
||||
getCacheDirectoryPathSpy.mockImplementation(
|
||||
(PackageManager: PackageManagerInfo) => {
|
||||
return new Promise<string>(resolve => {
|
||||
resolve('cache_directory_path');
|
||||
return new Promise<string[]>(resolve => {
|
||||
resolve(['cache_directory_path', 'cache_directory_path']);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
|
@ -48,7 +48,7 @@ describe('getPackageManagerInfo', () => {
|
|||
const packageManagerName = 'default';
|
||||
const expectedResult = {
|
||||
dependencyFilePattern: 'go.sum',
|
||||
getCacheFolderCommand: 'go env GOMODCACHE'
|
||||
cacheFolderCommandList: ['go env GOMODCACHE', 'go env GOCACHE']
|
||||
};
|
||||
|
||||
//Act + Assert
|
||||
|
@ -74,10 +74,10 @@ describe('getCacheDirectoryPath', () => {
|
|||
|
||||
const validPackageManager: PackageManagerInfo = {
|
||||
dependencyFilePattern: 'go.sum',
|
||||
getCacheFolderCommand: 'go env GOMODCACHE'
|
||||
cacheFolderCommandList: ['go env GOMODCACHE', 'go env GOCACHE']
|
||||
};
|
||||
|
||||
it('should return path to the cache folder which specified package manager uses', async () => {
|
||||
it('should return path to the cache folders which specified package manager uses', async () => {
|
||||
//Arrange
|
||||
getExecOutputSpy.mockImplementation((commandLine: string) => {
|
||||
return new Promise<exec.ExecOutput>(resolve => {
|
||||
|
@ -85,7 +85,7 @@ describe('getCacheDirectoryPath', () => {
|
|||
});
|
||||
});
|
||||
|
||||
const expectedResult = 'path/to/cache/folder';
|
||||
const expectedResult = ['path/to/cache/folder', 'path/to/cache/folder'];
|
||||
|
||||
//Act + Assert
|
||||
return cacheUtils
|
||||
|
|
Loading…
Add table
Reference in a new issue