Skip to content

v5.3.13

Choose a tag to compare

@github-actions github-actions released this 07 Jan 00:31
· 2 commits to main since this release
3dcca81

Add documentation for skipping individual PSModule framework tests (#252)

The Test-PSModule framework runs style and standards tests against source code (e.g., enforcing one function per file, requiring CmdletBinding attributes). Users needed guidance on skipping specific tests per-file when framework rules don't apply.

Changes

  • New documentation section "Skipping Individual Framework Tests" added to README
    • Syntax: #SkipTest:<TestID>:<Reason> comment at file top
    • Complete reference table of 10 SourceCode test IDs with descriptions
    • Module test overview (import/manifest validation)
    • Code example demonstrating skip usage
    • Best practices and configuration cross-references

Available Test IDs

Test ID What It Enforces
NumberOfProcessors Use [System.Environment]::ProcessorCount not $env:NUMBER_OF_PROCESSORS
Verbose Don't pass -Verbose to commands (overrides user preference)
OutNull Use $null = ... not | Out-Null
FunctionCount One function per file
FunctionName Filename matches function name
CmdletBinding All functions have [CmdletBinding()]
ParamBlock All functions have param() block
FunctionTest Public functions have tests

Example

#SkipTest:FunctionCount:Contains helper functions for main function

function Get-ComplexData {
    [CmdletBinding()]
    param([string]$Path)
    
    $data = Get-RawData -Path $Path
    return Format-ComplexData -Data $data
}

function Get-RawData { ... }
function Format-ComplexData { ... }

Based on analysis of Test-PSModule framework tests.

Original prompt

This section details on the original issue you should resolve

<issue_title>🩹 [Patch]: Add doc for how to skip framework (PSModule) tests</issue_title>
<issue_description>### Describe the change

Based on the code in PSModule/Test-PSModule, we need to recreate guidance in the readme on Process-PSModule for how users can skip individual tests from the framework, i.e. number of functions to have in a file.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.