diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 798d9ec..a3e35ce 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -114,6 +114,14 @@ describe('installer tests', () => { } }, 100000); + it('Resolving a normal generic version works', async() => { + const dotnetInstaller = new installer.DotnetCoreInstaller('3.1.x'); + let versInfo = await dotnetInstaller.resolveInfos(["win-x64"],new installer.DotNetVersionInfo("3.1.x")); + + expect(versInfo.resolvedVersion.startsWith('3.1.')); + }, 100000); + + it('Acquires version of dotnet if no matching version is installed', async () => { await getDotnet('2.2.205'); const dotnetDir = path.join(toolDir, 'dncs', '2.2.205', os.arch()); diff --git a/src/installer.ts b/src/installer.ts index a4f5e3c..23524ad 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -285,8 +285,7 @@ export class DotnetCoreInstaller { // Exclude versions that are newer than the latest if using not exact if(!versionInfo.isExactVersion()) { - - let latestSdk : string = releasesResponse['latest-sdk']; + let latestSdk : string = releasesResult['latest-sdk']; releasesInfo = releasesInfo.filter((releaseInfo: any) => semver.lte(releaseInfo['sdk']['version'], latestSdk)); }