From 3426e118588c742f99f7551479914469692818a7 Mon Sep 17 00:00:00 2001 From: litetex Date: Sat, 4 Apr 2020 19:44:50 +0200 Subject: [PATCH] More tests --- __tests__/installer.test.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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');