Adjust printWidth to 120.

This commit is contained in:
Fabio Niephaus
2025-02-10 09:16:33 +01:00
committed by Fabio Niephaus
parent 93a3b57d30
commit 9b77b7e1c6
33 changed files with 373 additions and 957 deletions

View File

@@ -24,17 +24,14 @@
* Forked from https://github.com/actions/setup-java/blob/5b36705a13905facb447b6812d613a06a07e371d/__tests__/cleanup-java.test.ts
*/
import {run as cleanup} from '../src/cleanup'
import { run as cleanup } from '../src/cleanup'
import * as core from '@actions/core'
import * as cache from '@actions/cache'
describe('cleanup', () => {
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>
let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>
let spyCacheSave: jest.SpyInstance<
ReturnType<typeof cache.saveCache>,
Parameters<typeof cache.saveCache>
>
let spyCacheSave: jest.SpyInstance<ReturnType<typeof cache.saveCache>, Parameters<typeof cache.saveCache>>
beforeEach(() => {
spyWarning = jest.spyOn(core, 'warning')
@@ -51,9 +48,7 @@ describe('cleanup', () => {
it('does not fail nor warn even when the save process throws a ReserveCacheError', async () => {
spyCacheSave.mockImplementation((_paths: string[], _key: string) =>
Promise.reject(
new cache.ReserveCacheError(
'Unable to reserve cache with key, another job may be creating this cache.'
)
new cache.ReserveCacheError('Unable to reserve cache with key, another job may be creating this cache.')
)
)
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
@@ -65,9 +60,7 @@ describe('cleanup', () => {
})
it('does not fail even though the save process throws error', async () => {
spyCacheSave.mockImplementation((_paths: string[], _key: string) =>
Promise.reject(new Error('Unexpected error'))
)
spyCacheSave.mockImplementation((_paths: string[], _key: string) => Promise.reject(new Error('Unexpected error')))
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
return name === 'cache' ? 'gradle' : ''
})
@@ -84,7 +77,7 @@ function resetState() {
* Create states to emulate a successful restore process.
*/
function createStateForSuccessfulRestore() {
jest.spyOn(core, 'getState').mockImplementation(name => {
jest.spyOn(core, 'getState').mockImplementation((name) => {
switch (name) {
case 'cache-primary-key':
return 'setup-java-cache-primary-key'