diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index a3e35ce..98f557d 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -116,11 +116,27 @@ describe('installer tests', () => { 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")); + let versInfo = await dotnetInstaller.resolveInfos(["win-x64"],new installer.DotNetVersionInfo('3.1.x')); expect(versInfo.resolvedVersion.startsWith('3.1.')); }, 100000); + it('Resolving a nonexistent generic version fails', async() => { + const dotnetInstaller = new installer.DotnetCoreInstaller('999.1.x'); + try{ + await dotnetInstaller.resolveInfos(["win-x64"],new installer.DotNetVersionInfo('999.1.x')); + fail(); + } catch { + expect(true); + } + }, 100000); + + it('Resolving a exact version works', async() => { + const dotnetInstaller = new installer.DotnetCoreInstaller('3.1.201'); + let versInfo = await dotnetInstaller.resolveInfos(["win-x64"],new installer.DotNetVersionInfo('3.1.201')); + + expect(versInfo.resolvedVersion).toBe('3.1.201'); + }, 100000); it('Acquires version of dotnet if no matching version is installed', async () => { await getDotnet('2.2.205');