(command: string)
| 39 | }; |
| 40 | |
| 41 | function findCacheFolder(command: string) { |
| 42 | switch (command) { |
| 43 | case 'npm config get cache': |
| 44 | return npmCachePath; |
| 45 | case 'pnpm store path --silent': |
| 46 | return pnpmCachePath; |
| 47 | case 'yarn cache dir': |
| 48 | return yarn1CachePath; |
| 49 | case 'yarn config get cacheFolder': |
| 50 | return yarn2CachePath; |
| 51 | default: |
| 52 | return 'packge/not/found'; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | let saveStateSpy: jest.SpyInstance; |
| 57 | let infoSpy: jest.SpyInstance; |