Update unit tests

This commit is contained in:
IvanZosimov 2023-04-12 16:44:51 +02:00
parent 34c30d0e81
commit 7358a44590
3 changed files with 7 additions and 5 deletions

View File

@ -177,17 +177,17 @@ jobs:
- name: Clear toolcache - name: Clear toolcache
shell: pwsh shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }} run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet '5.0.1xx' - name: Setup dotnet '5.0.2xx'
uses: ./ uses: ./
with: with:
dotnet-version: '5.0.1xx' dotnet-version: '5.0.2xx'
- name: Setup dotnet '7.0.1xx' - name: Setup dotnet '7.0.1xx'
uses: ./ uses: ./
with: with:
dotnet-version: '7.0.1xx' dotnet-version: '7.0.1xx'
- name: Verify dotnet - name: Verify dotnet
shell: pwsh shell: pwsh
run: __tests__/verify-dotnet.ps1 5.0.1 7.0.1 run: __tests__/verify-dotnet.ps1 5.0.2 7.0.1
test-setup-global-json-specified-and-version: test-setup-global-json-specified-and-version:
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}

3
dist/index.js vendored
View File

@ -290,9 +290,10 @@ class DotnetVersionResolver {
this.resolvedArgument.value = yield this.getLatestByMajorTag(major); this.resolvedArgument.value = yield this.getLatestByMajorTag(major);
} }
else { else {
// Resolve LTS version of .NET if "dotnet-version" is specified as *, x or X
this.resolvedArgument.value = 'LTS'; this.resolvedArgument.value = 'LTS';
} }
this.resolvedArgument.qualityFlag = +major >= 6 ? true : false; this.resolvedArgument.qualityFlag = parseInt(major) >= 6 ? true : false;
}); });
} }
createDotNetVersion() { createDotNetVersion() {

View File

@ -70,9 +70,10 @@ export class DotnetVersionResolver {
} else if (this.isNumericTag(major)) { } else if (this.isNumericTag(major)) {
this.resolvedArgument.value = await this.getLatestByMajorTag(major); this.resolvedArgument.value = await this.getLatestByMajorTag(major);
} else { } else {
// Resolve LTS version of .NET if "dotnet-version" is specified as *, x or X
this.resolvedArgument.value = 'LTS'; this.resolvedArgument.value = 'LTS';
} }
this.resolvedArgument.qualityFlag = +major >= 6 ? true : false; this.resolvedArgument.qualityFlag = parseInt(major) >= 6 ? true : false;
} }
public async createDotNetVersion(): Promise<DotnetVersion> { public async createDotNetVersion(): Promise<DotnetVersion> {