Tests are now covering the correct preview-format

This commit is contained in:
litetex 2020-05-21 13:02:58 +02:00
parent 994f136361
commit a8eaac54ab
1 changed files with 12 additions and 2 deletions

View File

@ -16,7 +16,7 @@ import * as installer from '../src/installer';
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
describe('version tests', () => { 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", "Exact version '%s' should be the same",
vers => { vers => {
let versInfo = new installer.DotNetVersionInfo(vers); let versInfo = new installer.DotNetVersionInfo(vers);
@ -108,7 +108,7 @@ describe('installer tests', () => {
} }
}, 100000); }, 100000);
it('Resolving a exact version works', async () => { it('Resolving a exact stable version works', async () => {
const dotnetInstaller = new installer.DotnetCoreInstaller('3.1.201'); const dotnetInstaller = new installer.DotnetCoreInstaller('3.1.201');
let versInfo = await dotnetInstaller.resolveInfos( let versInfo = await dotnetInstaller.resolveInfos(
['win-x64'], ['win-x64'],
@ -118,6 +118,16 @@ describe('installer tests', () => {
expect(versInfo.resolvedVersion).toBe('3.1.201'); expect(versInfo.resolvedVersion).toBe('3.1.201');
}, 100000); }, 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 () => { it('Acquires version of dotnet if no matching version is installed', async () => {
await getDotnet('2.2.205'); await getDotnet('2.2.205');
const dotnetDir = path.join(toolDir, 'dncs', '2.2.205', os.arch()); const dotnetDir = path.join(toolDir, 'dncs', '2.2.205', os.arch());