Add markdown lint errors as test failure message (#4189)

This commit is contained in:
Steve Lee
2017-07-05 21:47:42 -07:00
committed by Dongbo Wang
parent 8205edabf3
commit dda482eaac
+4 -11
View File
@@ -102,21 +102,14 @@ Describe 'Common Tests - Validate Markdown Files' -Tag 'CI' {
$mdIssuesPath | should exist
Get-Content -Path $mdIssuesPath | ForEach-Object -Process {
if ([string]::IsNullOrEmpty($_) -eq $false -and $_ -ne '--EMPTY--')
{
Write-Warning -Message $_
$mdErrors ++
}
}
[string] $markdownErrors = Get-Content -Path $mdIssuesPath
Remove-Item -Path $mdIssuesPath -Force -ErrorAction SilentlyContinue
if($mdErrors -gt 0)
if ($markdownErrors -ne "--EMPTY--")
{
Write-Warning 'See https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md for an explination of the error codes.'
$markdownErrors += ' (See https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md for an explanation of the error codes)'
}
$mdErrors | Should Be 0
$markdownErrors | Should BeExactly "--EMPTY--"
}
}