Skip to content

Commit 0836002

Browse files
committed
feat(#212): update Pester code coverage configuration for private scripts
- Refine path patterns to include nested private scripts - Add tests for project.json Pester coverage configuration
1 parent 51b8fb9 commit 0836002

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

project.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
"Enabled": true,
4545
"Path": [
4646
"src/public/*.ps1",
47-
"src/private/**/*.ps1"
47+
"src/private/*.ps1",
48+
"src/private/*/*.ps1",
49+
"src/private/*/*/*.ps1"
4850
],
4951
"CoveragePercentTarget": 99,
5052
"OutputPath": "artifacts/coverage.xml",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
BeforeAll {
2+
$projectRoot = Split-Path -Parent $PSScriptRoot
3+
$script:projectJson = Get-Content -LiteralPath (Join-Path $projectRoot 'project.json') -Raw | ConvertFrom-Json -AsHashtable
4+
}
5+
6+
Describe 'project.json Pester code coverage configuration' {
7+
It 'uses explicit private-source globs so nested helpers stay measurable' {
8+
$script:projectJson.Pester.CodeCoverage.Path | Should -Be @(
9+
'src/public/*.ps1'
10+
'src/private/*.ps1'
11+
'src/private/*/*.ps1'
12+
'src/private/*/*/*.ps1'
13+
)
14+
}
15+
}

0 commit comments

Comments
 (0)