@@ -32,13 +32,13 @@ describe('cache-restore', () => {
32
32
33
33
function findCacheFolder ( command : string ) {
34
34
switch ( command ) {
35
- case utils . supportedPackageManagers . npm . getCacheFolderCommand :
35
+ case ' npm config get cache' :
36
36
return npmCachePath ;
37
- case utils . supportedPackageManagers . pnpm . getCacheFolderCommand :
37
+ case ' pnpm store path --silent' :
38
38
return pnpmCachePath ;
39
- case utils . supportedPackageManagers . yarn1 . getCacheFolderCommand :
39
+ case 'yarn cache dir' :
40
40
return yarn1CachePath ;
41
- case utils . supportedPackageManagers . yarn2 . getCacheFolderCommand :
41
+ case 'yarn config get cacheFolder' :
42
42
return yarn2CachePath ;
43
43
default :
44
44
return 'packge/not/found' ;
@@ -108,7 +108,7 @@ describe('cache-restore', () => {
108
108
it . each ( [ [ 'npm7' ] , [ 'npm6' ] , [ 'pnpm6' ] , [ 'yarn1' ] , [ 'yarn2' ] , [ 'random' ] ] ) (
109
109
'Throw an error because %s is not supported' ,
110
110
async packageManager => {
111
- await expect ( restoreCache ( packageManager ) ) . rejects . toThrow (
111
+ await expect ( restoreCache ( packageManager , '' ) ) . rejects . toThrow (
112
112
`Caching for '${ packageManager } ' is not supported`
113
113
) ;
114
114
}
@@ -132,7 +132,7 @@ describe('cache-restore', () => {
132
132
}
133
133
} ) ;
134
134
135
- await restoreCache ( packageManager ) ;
135
+ await restoreCache ( packageManager , '' ) ;
136
136
expect ( hashFilesSpy ) . toHaveBeenCalled ( ) ;
137
137
expect ( infoSpy ) . toHaveBeenCalledWith (
138
138
`Cache restored from key: node-cache-${ platform } -${ packageManager } -${ fileHash } `
@@ -163,7 +163,7 @@ describe('cache-restore', () => {
163
163
} ) ;
164
164
165
165
restoreCacheSpy . mockImplementationOnce ( ( ) => undefined ) ;
166
- await restoreCache ( packageManager ) ;
166
+ await restoreCache ( packageManager , '' ) ;
167
167
expect ( hashFilesSpy ) . toHaveBeenCalled ( ) ;
168
168
expect ( infoSpy ) . toHaveBeenCalledWith (
169
169
`${ packageManager } cache is not found`
0 commit comments