Open jfixemer opened 3 years ago
You can also provide a -TestResult
to Invoke-PSCodeHealth
. So run your Pester 5 tests with -PassThru
and then pipe that into ConvertTo-Pester4Result
. You do have to manage the currently imported version of Pester though.
Import-Module Pester -MinimumVersion 5.0.0
$configuration = [PesterConfiguration]::Default
$configuration.Run.Path = $TestPath
$configuration.Run.PassThru = $true
$testResult = Invoke-Pester -Configuration $configuration | ConvertTo-Pester4Result
Remove-Module Pester -Force
Import-Module Pester -MaximumVersion 4.*
Invoke-PSCodeHealth -Path $CodePath -TestsResult $testResult
Before submitting a bug report, please ensure you :
powershell -NoProfile
)Describe the Problem
Throws warnings and quite likely does not work properly with Pester v5.0 Pester v5.0 changed from command line switches, hashtables, etc. to a single Configuration nested hashtable object.
Steps To Reproduce
Expected behavior
PSCodeHealth should detect the Pester version and invoke the command properly.
Environment
Additional context
How has this issue affected you ? Prevents us from migrating to new version of Pester. What are you trying to accomplish ? Basic functionality advertised by the package. Providing context helps us come up with a solution that is most useful and prioritize issues.