From 5c7ae4f903bf66132fcb45919c862b391773a04c Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Wed, 24 May 2023 16:59:05 +0200 Subject: [PATCH] Apply consistent naming --- __tests__/installer.test.ts | 16 ++++++++-------- src/installer.ts | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index c9f815e..3403c20 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -298,7 +298,7 @@ describe('installer tests', () => { }); describe('DotnetVersionResolver tests', () => { - describe('createDotNetVersion() tests', () => { + describe('createDotnetVersion() tests', () => { each([ '3.1', '3.x', @@ -315,7 +315,7 @@ describe('installer tests', () => { version ); const versionObject = - await dotnetVersionResolver.createDotNetVersion(); + await dotnetVersionResolver.createDotnetVersion(); expect(!!versionObject.value).toBe(true); } @@ -354,7 +354,7 @@ describe('installer tests', () => { ); await expect( - async () => await dotnetVersionResolver.createDotNetVersion() + async () => await dotnetVersionResolver.createDotnetVersion() ).rejects.toThrow(); } ); @@ -366,7 +366,7 @@ describe('installer tests', () => { version ); const versionObject = - await dotnetVersionResolver.createDotNetVersion(); + await dotnetVersionResolver.createDotnetVersion(); expect(versionObject.type.toLowerCase().includes('channel')).toBe( true @@ -381,7 +381,7 @@ describe('installer tests', () => { version ); const versionObject = - await dotnetVersionResolver.createDotNetVersion(); + await dotnetVersionResolver.createDotnetVersion(); expect(versionObject.type.toLowerCase().includes('channel')).toBe( true @@ -397,7 +397,7 @@ describe('installer tests', () => { version ); const versionObject = - await dotnetVersionResolver.createDotNetVersion(); + await dotnetVersionResolver.createDotnetVersion(); expect(versionObject.type.toLowerCase().includes('version')).toBe( true @@ -413,7 +413,7 @@ describe('installer tests', () => { version ); const versionObject = - await dotnetVersionResolver.createDotNetVersion(); + await dotnetVersionResolver.createDotnetVersion(); const windowsRegEx = new RegExp(/^-(Version|Channel)/); const nonWindowsRegEx = new RegExp(/^--(version|channel)/); @@ -433,7 +433,7 @@ describe('installer tests', () => { version ); await expect( - async () => await dotnetVersionResolver.createDotNetVersion() + async () => await dotnetVersionResolver.createDotnetVersion() ).rejects.toThrow( `'dotnet-version' was supplied in invalid format: ${version}! The A.B.Cxx syntax is available since the .NET 5.0 release.` ); diff --git a/src/installer.ts b/src/installer.ts index 264286b..f44615c 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -81,7 +81,7 @@ export class DotnetVersionResolver { parseInt(major) >= QUALITY_INPUT_MINIMAL_MAJOR_TAG ? true : false; } - public async createDotNetVersion(): Promise { + public async createDotnetVersion(): Promise { await this.resolveVersionInput(); if (!this.resolvedArgument.type) { return this.resolvedArgument; @@ -102,7 +102,7 @@ export class DotnetVersionResolver { maxRetries: 3 }); const response = await httpClient.getJson( - DotnetVersionResolver.DotNetCoreIndexUrl + DotnetVersionResolver.DotnetCoreIndexUrl ); const result = response.result || {}; const releasesInfo: any[] = result['releases-index']; @@ -114,14 +114,14 @@ export class DotnetVersionResolver { if (!releaseInfo) { throw new Error( - `Could not find info for version with major tag: "${majorTag}" at ${DotnetVersionResolver.DotNetCoreIndexUrl}` + `Could not find info for version with major tag: "${majorTag}" at ${DotnetVersionResolver.DotnetCoreIndexUrl}` ); } return releaseInfo['channel-version']; } - static DotNetCoreIndexUrl = + static DotnetCoreIndexUrl = 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; } @@ -256,7 +256,7 @@ export class DotnetCoreInstaller { public async installDotnet(): Promise { const versionResolver = new DotnetVersionResolver(this.version); - const dotnetVersion = await versionResolver.createDotNetVersion(); + const dotnetVersion = await versionResolver.createDotnetVersion(); const installScript = new DotnetInstallScript() .useArguments(