From a8eaac54ab5fe1b2fba429e760af3c666cbb88c0 Mon Sep 17 00:00:00 2001 From: litetex Date: Thu, 21 May 2020 13:02:58 +0200 Subject: [PATCH] Tests are now covering the correct preview-format --- __tests__/installer.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index bd60bdc..0237c32 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -16,7 +16,7 @@ import * as installer from '../src/installer'; const IS_WINDOWS = process.platform === 'win32'; describe('version tests', () => { - each(['3.1.999', '3.1.101-preview']).test( + each(['3.1.999', '3.1.101-preview.3']).test( "Exact version '%s' should be the same", vers => { let versInfo = new installer.DotNetVersionInfo(vers); @@ -108,7 +108,7 @@ describe('installer tests', () => { } }, 100000); - it('Resolving a exact version works', async () => { + it('Resolving a exact stable version works', async () => { const dotnetInstaller = new installer.DotnetCoreInstaller('3.1.201'); let versInfo = await dotnetInstaller.resolveInfos( ['win-x64'], @@ -118,6 +118,16 @@ describe('installer tests', () => { expect(versInfo.resolvedVersion).toBe('3.1.201'); }, 100000); + it('Resolving a exact preview version works', async () => { + const dotnetInstaller = new installer.DotnetCoreInstaller('5.0.0-preview.4'); + let versInfo = await dotnetInstaller.resolveInfos( + ['win-x64'], + new installer.DotNetVersionInfo('5.0.0-preview.4') + ); + + expect(versInfo.resolvedVersion).toBe('5.0.0-preview.4'); + }, 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());