Open johlju opened 2 years ago
For this to work we need to get coverage for a specific source file in the built module (e.g. MOF-based DSC resource) using CodeCoveragePath
, or a particular function inside the built module script file (.psm1) for modules using pattern Public/Private/Classes, using the same build.ps1 parameter CodeCoveragePath
but pass an [System.Collections.IDictionary]
like Pester expects. For the latter we need a way to single out the lines of an individual function or functions.
But it is not possible to pass an [System.Collections.IDictionary]
to Pester due to issue https://github.com/pester/Pester/issues/2190.
Problem description
Currently when running
./build.ps1 -Task test -PesterPath ‘testfile’
it runs code coverage on all files in the built module result in a lot out missed lines (especially for big modules).To be able to run code coverage for a single file using
Invoke-Pester
you have to pass aNew-PesterConfiguration
filled with the code script path and coverage path and settings. This can be complicated for new contributors.Verbose logs
How to reproduce
n/a
Expected behavior
n/a
Current behavior
n/a
Suggested solution
We should simplify that by adding a
CodeCovergePath
tobuild.ps1
so it possible to write:It will then also use settings from the build configuration.
Operating system the target node is running
PowerShell version and build the target node is running
Module version used