@@ -143,9 +143,11 @@ Describe 'Get-ProcessPSModuleWorkflowInventory' {
143143 Get-Content - LiteralPath $markdownPath - Raw | Should -Match ' 0 0 \\\* \\\* \\\*'
144144 }
145145
146- It ' records a parse error for a matching malformed workflow' {
146+ It ' reports and fails closed for a matching malformed workflow' {
147147 $malformedRoot = Join-Path $testRoot ' Malformed'
148148 $malformedWorkflowRoot = Join-Path $malformedRoot ' .github/workflows'
149+ $jsonPath = Join-Path $malformedRoot ' output/inventory.json'
150+ $markdownPath = Join-Path $malformedRoot ' output/inventory.md'
149151 & git init -- quiet -- initial- branch= main $malformedRoot
150152 & git - C $malformedRoot config user.email ' inventory-tests@example.invalid'
151153 & git - C $malformedRoot config user.name ' Inventory Tests'
@@ -160,11 +162,21 @@ jobs:
160162 & git - C $malformedRoot add .
161163 & git - C $malformedRoot commit -- quiet - m ' Add malformed workflow'
162164
163- $result = @ (& $scriptPath - Path $malformedRoot )
164-
165+ {
166+ & $scriptPath `
167+ - Path $malformedRoot `
168+ - TargetReference ' v8' `
169+ - JsonPath $jsonPath `
170+ - MarkdownPath $markdownPath |
171+ Out-Null
172+ } | Should - Throw - ExpectedMessage ' *1 matching workflow file(s) could not be parsed*'
173+
174+ $result = @ (Get-Content - LiteralPath $jsonPath - Raw | ConvertFrom-Json )
165175 $result.Count | Should - Be 1
166176 $result [0 ].Status | Should - Be ' ParseError'
167177 $result [0 ].Error | Should -Not - BeNullOrEmpty
178+ Get-Content - LiteralPath $markdownPath - Raw | Should -Match ' Parse errors: 1'
179+ Get-Content - LiteralPath $markdownPath - Raw | Should -Match ' Matching target: 0/1'
168180 }
169181
170182 It ' fails closed when no matching workflow is found' {
0 commit comments