@@ -163,6 +163,15 @@ The [PSModule - SourceCode tests](./scripts/tests/SourceCode/PSModule/PSModule.T
163163 - [ PSModule framework settings for style and standards for modules] ( https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#module-tests )
164164 - [ PSScriptAnalyzer rules] ( https://github.com/PSModule/Invoke-ScriptAnalyzer )
165165- This produces a JSON-based report that is used by [ Get-PesterTestResults] ( #get-test-results ) evaluate the results of the tests.
166+ - ** Code coverage for framework-generated code** : This step also collects code coverage. During the
167+ [ build step] ( #build-module ) , [ Build-PSModule] ( https://github.com/PSModule/Build-PSModule ) injects boilerplate code
168+ into the compiled ` .psm1 ` file — including the ` $IsWindows ` compatibility shim, type accelerator registration for
169+ public classes and enums, and the ` OnRemove ` cleanup hook. Because this code is generated by the framework, module
170+ authors have no way to test it themselves. The framework tests in
171+ [ Test-PSModule] ( https://github.com/PSModule/Test-PSModule ) exercise these code paths so they are covered.
172+ The coverage artifacts from this step are aggregated with coverage from
173+ [ Test-ModuleLocal] ( #test-module ) in the [ Get code coverage] ( #get-code-coverage ) step, ensuring that
174+ framework-generated lines no longer appear as uncovered in the module author's coverage report.
166175
167176### Test module
168177
@@ -299,6 +308,9 @@ The [PSModule - Module tests](./scripts/tests/Module/PSModule/PSModule.Tests.ps1
299308
300309[ workflow] ( ./.github/workflows/Get-CodeCoverage.yml )
301310- Gathers the code coverage from the previous steps and creates a summary of the results.
311+ - Coverage is aggregated from both the [ Framework test] ( #framework-test ) step (which covers framework-generated
312+ boilerplate) and the [ Test module] ( #test-module ) step (which covers module author code). A command that is executed
313+ in either step counts as covered. This ensures module authors are not penalized for lines they did not write.
302314- If the code coverage is below the target, the workflow will fail here.
303315
304316### Publish module
0 commit comments