Skip to content

Commit 44ad01d

Browse files
committed
Merge pull request #1703 from Microsoft/users/ersciple/m100fixtest
Fix test on PS4.
2 parents 93c5998 + 6ecf6c9 commit 44ad01d

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

Tests/L0/SonarQubePostTest/SummaryReport.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ Unregister-Mock IsPrBuild
7979

8080

8181
### Test 3 - Fetching the quality gate warnings and errors
82-
83-
$qualityGateResponse = Get-Content "$PSScriptRoot\data\ReportTest\qualityGateResponse.json" | ConvertFrom-Json
84-
$metricsResponse = Get-Content "$PSScriptRoot\data\ReportTest\metricsResponse.json" | ConvertFrom-Json
82+
$qualityGateResponse = Get-Content "$PSScriptRoot\data\ReportTest\qualityGateResponse.json" | Out-String | ConvertFrom-Json
83+
$metricsResponse = Get-Content "$PSScriptRoot\data\ReportTest\metricsResponse.json" | Out-String | ConvertFrom-Json
8584
Register-Mock FetchMetricNames {$metricsResponse.metrics}
8685

8786
# Act

Tests/L0/SonarQubePostTest/_suite.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('SonarQubePostTest Suite', function () {
2525
psr.kill();
2626
});
2727

28-
if (ps) {
28+
if (ps) {
2929
it('DisableAnalysisOnPrBuild tests', (done) => {
3030
psr.run(path.join(__dirname, 'DisableAnalysisOnPrBuild.ps1'), done);
3131
})
@@ -44,8 +44,8 @@ describe('SonarQubePostTest Suite', function () {
4444
it('SonarQubeMetrics tests', (done) => {
4545
psr.run(path.join(__dirname, 'SonarQubeMetrics.ps1'), done);
4646
})
47-
//it('SummaryReport tests', (done) => {
48-
// psr.run(path.join(__dirname, 'SummaryReport.ps1'), done);
49-
//})
47+
it('SummaryReport tests', (done) => {
48+
psr.run(path.join(__dirname, 'SummaryReport.ps1'), done);
49+
})
5050
}
5151
});

Tests/lib/Start-TestRunner.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ try {
2020
}
2121
2222
if ($PSVersionTable.PSVersion -lt [version]'5.0') {
23-
function global:Write-Host_d9245505 {
23+
function global:Write-Host {
2424
$OFS = ' '
2525
Write-Verbose "Write-Host $args"
2626
}
27-
28-
New-Alias -Name 'Write-Host' -Value "global:Write-Host_d9245505" -Scope global
2927
}
3028
3129
. $Path *>&1

0 commit comments

Comments
 (0)