Skip to content

Commit d2d9cca

Browse files
author
Kapil Borle
committed
Add tests for comment help for non-exported functions
1 parent 1de9cfe commit d2d9cca

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/Rules/ProvideCommentHelp.tests.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ Describe "ProvideCommentHelp" {
3636
$violations[1].Extent.Text | Should Be "Comment"
3737
}
3838

39+
It "should find violations in functions that are not exported" {
40+
$def = @'
41+
function foo {
42+
}
43+
'@
44+
$settings = @{
45+
IncludeRules = @("PSProvideCommentHelp")
46+
Rules = @{
47+
PSProvideCommentHelp = @{
48+
Enable = $true
49+
ExportedOnly = $false
50+
}
51+
}
52+
}
53+
Invoke-ScriptAnalyzer -ScriptDefinition $def -Settings $settings | Get-Count | Should Be 1
54+
}
3955
It "should return a help snippet correction with 0 parameters" {
4056
$def = @'
4157
function foo {

0 commit comments

Comments
 (0)