From 9b08f07cd305c6060f08e4b64d1805429a773711 Mon Sep 17 00:00:00 2001 From: Daniel Kennedy Date: Thu, 25 Sep 2025 09:26:13 -0400 Subject: [PATCH] Fix linting --- .../artifact/__tests__/download-artifact.test.ts | 12 +++++------- .../src/internal/download/download-artifact.ts | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 9f26880c..ec930272 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -3,7 +3,7 @@ import * as http from 'http' import * as net from 'net' import * as path from 'path' import * as github from '@actions/github' -import {HttpClient, HttpClientResponse} from '@actions/http-client' +import {HttpClient} from '@actions/http-client' import type {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types' import archiver from 'archiver' @@ -621,12 +621,10 @@ describe('download-artifact', () => { }) }) }) - + describe('streamExtractExternal', () => { it('should fail if the timeout is exceeded', async () => { - - const mockSlowGetArtifact = jest - .fn(mockGetArtifactHung) + const mockSlowGetArtifact = jest.fn(mockGetArtifactHung) const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( () => { @@ -640,10 +638,10 @@ describe('download-artifact', () => { await streamExtractExternal( fixtures.blobStorageUrl, fixtures.workspaceDir, - { timeout: 2 } + {timeout: 2} ) expect(true).toBe(false) // should not be called - } catch (e: any) { + } catch (e) { expect(e).toBeInstanceOf(Error) expect(e.message).toContain('did not respond in 2ms') expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 40f8d71b..b760e77a 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -65,7 +65,7 @@ async function streamExtract( export async function streamExtractExternal( url: string, directory: string, - opts: { timeout: number } = { timeout: 30 * 1000 } + opts: {timeout: number} = {timeout: 30 * 1000} ): Promise { const client = new httpClient.HttpClient(getUserAgentString()) const response = await client.get(url)