mirror of
https://github.com/actions/setup-go.git
synced 2025-05-04 14:14:34 +00:00
Add and configure ESLint and update configuration for Prettier (#341)
* Turn on ESLint and update Prettier * Update eslint config * Update eslint config * Update dependencies * Update ESLint and Prettier configurations * update package.json * Update prettier command * Update prettier config file * Change CRLF to LF * Update docs * Update docs
This commit is contained in:
@ -8,14 +8,14 @@ import {PackageManagerInfo} from '../src/package-managers';
|
||||
|
||||
describe('restoreCache', () => {
|
||||
//Arrange
|
||||
let hashFilesSpy = jest.spyOn(glob, 'hashFiles');
|
||||
let getCacheDirectoryPathSpy = jest.spyOn(
|
||||
const hashFilesSpy = jest.spyOn(glob, 'hashFiles');
|
||||
const getCacheDirectoryPathSpy = jest.spyOn(
|
||||
cacheUtils,
|
||||
'getCacheDirectoryPath'
|
||||
);
|
||||
let restoreCacheSpy = jest.spyOn(cache, 'restoreCache');
|
||||
let infoSpy = jest.spyOn(core, 'info');
|
||||
let setOutputSpy = jest.spyOn(core, 'setOutput');
|
||||
const restoreCacheSpy = jest.spyOn(cache, 'restoreCache');
|
||||
const infoSpy = jest.spyOn(core, 'info');
|
||||
const setOutputSpy = jest.spyOn(core, 'setOutput');
|
||||
|
||||
const versionSpec = '1.13.1';
|
||||
const packageManager = 'default';
|
||||
@ -40,13 +40,13 @@ describe('restoreCache', () => {
|
||||
});
|
||||
|
||||
//Act + Assert
|
||||
expect(async () => {
|
||||
await expect(async () => {
|
||||
await cacheRestore.restoreCache(
|
||||
versionSpec,
|
||||
packageManager,
|
||||
cacheDependencyPath
|
||||
);
|
||||
}).rejects.toThrowError(
|
||||
}).rejects.toThrow(
|
||||
'Some specified paths were not resolved, unable to cache dependencies.'
|
||||
);
|
||||
});
|
||||
@ -71,7 +71,7 @@ describe('restoreCache', () => {
|
||||
packageManager,
|
||||
cacheDependencyPath
|
||||
);
|
||||
expect(infoSpy).toBeCalledWith(`Cache is not found`);
|
||||
expect(infoSpy).toHaveBeenCalledWith(`Cache is not found`);
|
||||
});
|
||||
|
||||
it('should set output if cache hit is occured', async () => {
|
||||
@ -94,6 +94,6 @@ describe('restoreCache', () => {
|
||||
packageManager,
|
||||
cacheDependencyPath
|
||||
);
|
||||
expect(setOutputSpy).toBeCalledWith('cache-hit', true);
|
||||
expect(setOutputSpy).toHaveBeenCalledWith('cache-hit', true);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user