More tests and more fixes

This commit is contained in:
litetex 2020-04-04 19:34:45 +02:00
parent 5411b6342a
commit ebefd7bccb
2 changed files with 9 additions and 2 deletions

View File

@ -114,6 +114,14 @@ describe('installer tests', () => {
} }
}, 100000); }, 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 () => { 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());

View File

@ -285,8 +285,7 @@ export class DotnetCoreInstaller {
// Exclude versions that are newer than the latest if using not exact // Exclude versions that are newer than the latest if using not exact
if(!versionInfo.isExactVersion()) { if(!versionInfo.isExactVersion()) {
let latestSdk : string = releasesResult['latest-sdk'];
let latestSdk : string = releasesResponse['latest-sdk'];
releasesInfo = releasesInfo.filter((releaseInfo: any) => semver.lte(releaseInfo['sdk']['version'], latestSdk)); releasesInfo = releasesInfo.filter((releaseInfo: any) => semver.lte(releaseInfo['sdk']['version'], latestSdk));
} }