From dda482eaacdd95ad5d080d64108502a8e54bdc89 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Wed, 5 Jul 2017 21:47:42 -0700 Subject: [PATCH] Add markdown lint errors as test failure message (#4189) --- test/common/markdown/markdown.tests.ps1 | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/test/common/markdown/markdown.tests.ps1 b/test/common/markdown/markdown.tests.ps1 index 91f8181fc3..4d35830bcb 100644 --- a/test/common/markdown/markdown.tests.ps1 +++ b/test/common/markdown/markdown.tests.ps1 @@ -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--" } }