From 87063ef0add0e22b68aefd914b1349a2ab0a94b1 Mon Sep 17 00:00:00 2001 From: Aparna Jyothi Date: Fri, 28 Feb 2025 16:16:00 +0530 Subject: [PATCH] npm run format --- __tests__/main.test.ts | 7 ++----- dist/setup/index.js | 6 ++---- src/distributions/base-distribution.ts | 14 +++++++++----- .../official_builds/official_builds.ts | 4 +++- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 3da27e3d..15a777c2 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -13,7 +13,7 @@ import each from 'jest-each'; import * as main from '../src/main'; import * as util from '../src/util'; import OfficialBuilds from '../src/distributions/official_builds/official_builds'; -import { validateMirrorURL } from '../src/util'; +import {validateMirrorURL} from '../src/util'; describe('main tests', () => { let inputs = {} as any; @@ -284,12 +284,10 @@ describe('main tests', () => { describe('mirror-url parameter', () => { beforeEach(() => { inputs['mirror-url'] = 'https://custom-mirror-url.com'; - - }); afterEach(() => { - delete inputs['mirror-url']; + delete inputs['mirror-url']; }); it('Read mirror-url if mirror-url is provided', async () => { @@ -316,5 +314,4 @@ describe('main tests', () => { ); }); }); - }); diff --git a/dist/setup/index.js b/dist/setup/index.js index afdc69de..61c448f1 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -100165,12 +100165,10 @@ class BaseDistribution { catch (err) { if (err instanceof Error && err.message.includes('getaddrinfo EAI_AGAIN')) { - core.setFailed(`Network error: Failed to resolve the server at ${dataUrl}. - Please check your DNS settings or verify that the URL is correct.`); + core.setFailed(`Network error: Failed to resolve the server at ${dataUrl}.Please check your DNS settings or verify that the URL is correct.`); } else if (err instanceof hc.HttpClientError && err.statusCode === 404) { - core.setFailed(`404 Error: Unable to find versions at ${dataUrl}. - Please verify that the mirror URL is valid.`); + core.setFailed(`404 Error: Unable to find versions at ${dataUrl}.Please verify that the mirror URL is valid.`); } else { core.setFailed(`Failed to fetch Node.js versions from ${dataUrl}.Please check the URL and try again.}`); diff --git a/src/distributions/base-distribution.ts b/src/distributions/base-distribution.ts index ddb86c9b..21923ab4 100644 --- a/src/distributions/base-distribution.ts +++ b/src/distributions/base-distribution.ts @@ -116,13 +116,17 @@ export default abstract class BaseDistribution { err instanceof Error && err.message.includes('getaddrinfo EAI_AGAIN') ) { - core.setFailed(`Network error: Failed to resolve the server at ${dataUrl}. - Please check your DNS settings or verify that the URL is correct.`); + core.setFailed( + `Network error: Failed to resolve the server at ${dataUrl}.Please check your DNS settings or verify that the URL is correct.` + ); } else if (err instanceof hc.HttpClientError && err.statusCode === 404) { - core.setFailed(`404 Error: Unable to find versions at ${dataUrl}. - Please verify that the mirror URL is valid.`); + core.setFailed( + `404 Error: Unable to find versions at ${dataUrl}.Please verify that the mirror URL is valid.` + ); } else { - core.setFailed(`Failed to fetch Node.js versions from ${dataUrl}.Please check the URL and try again.}`); + core.setFailed( + `Failed to fetch Node.js versions from ${dataUrl}.Please check the URL and try again.}` + ); } throw err; } diff --git a/src/distributions/official_builds/official_builds.ts b/src/distributions/official_builds/official_builds.ts index ba8236aa..1b5bed5c 100644 --- a/src/distributions/official_builds/official_builds.ts +++ b/src/distributions/official_builds/official_builds.ts @@ -341,7 +341,9 @@ export default class OfficialBuilds extends BaseDistribution { ); } else { // For any other error type, you can log the error message. - core.setFailed(`An unexpected error occurred like url might not correct`); + core.setFailed( + `An unexpected error occurred like url might not correct` + ); } throw error;