Skip to content

Commit

Permalink
Remove hardcoded patch version from unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Safonkin committed Aug 20, 2021
1 parent b7b99f3 commit 5e45b4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion __tests__/setup-dotnet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const toolDir = path.join(__dirname, 'runner', 'tools2');
const tempDir = path.join(__dirname, 'runner', 'temp2');

import * as setup from '../src/setup-dotnet';
import * as dotnetInstaller from '../src/installer';

const IS_WINDOWS = process.platform === 'win32';

Expand Down Expand Up @@ -51,9 +52,13 @@ describe('setup-dotnet tests', () => {
if (!fs.existsSync(globalJsonPath)) {
fs.writeFileSync(globalJsonPath, jsonContents);
}

const version = '3.1'
const installer = new dotnetInstaller.DotnetCoreInstaller(version)
const patchVersion = await installer.resolveVersion(new dotnetInstaller.DotNetVersionInfo(version))
await setup.run();

expect(fs.existsSync(path.join(toolDir, 'sdk', '3.1.412'))).toBe(true);
expect(fs.existsSync(path.join(toolDir, 'sdk', patchVersion))).toBe(true);
if (IS_WINDOWS) {
expect(fs.existsSync(path.join(toolDir, 'dotnet.exe'))).toBe(true);
} else {
Expand Down

0 comments on commit 5e45b4b

Please sign in to comment.