You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before submitting a bug report, please ensure you :
Verified this bug is not already reported in an issue
Can reproduce in a clean PowerShell session (clean = 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
Import-Module Pester -RequiredVersion 5.0.4
Run Invoke-PSCodeHealth -Path .\src -TestsPath .\tests
Error or unexpected behavior :
WARNING: You are using Legacy parameter set that adapts Pester 5 syntax to Pester 4 syntax. This parameter set is
deprecated, and does not work 100%. The -Strict and -PesterOption parameters are ignored, and providing advanced
configuration to -Path (-Script), and -CodeCoverage via a hash table does not work. Please refer to
https://github.com/pester/Pester/releases/tag/5.0.1#legacy-parameter-set for more information.
Resolve-CoverageInfo : Could not resolve coverage path 'System.Collections.Hashtable': Cannot find path
'...\System.Collections.Hashtable' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\pester\5.0.4\Pester.psm1:7149 char:5
+ Resolve-CoverageInfo -UnresolvedCoverageInfo $unresolvedCoverageI ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Resolve-CoverageInfo
Expected behavior
PSCodeHealth should detect the Pester version and invoke the command properly.
Environment
Operating system : Windows10
PowerShell version : 5.1.18362.1110
PSCodeHealth version : 0.2.26
Pester: 5.0.4
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.
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.
Activity
wethreetrees commentedon Nov 26, 2020
You can also provide a
-TestResulttoInvoke-PSCodeHealth. So run your Pester 5 tests with-PassThruand then pipe that intoConvertTo-Pester4Result. You do have to manage the currently imported version of Pester though.