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
Build fails, because the whole testing setup is made for Pester <4.9.x, and the Install-Script for AppVeyor installs the latest Pester-version (5.0.x)
Error:
----
C:\projects\pstoggl
. .\AppVeyor\Test.ps1
Current working directory: C:\projects\pstoggl
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.
Starting discovery in 20 files.
Discovery finished in 4.64s.
[-] General code style compliance.Module 'C:\projects\pstoggl\.codecovio\CodeCovIo.psm1'.passes the PSScriptAnalyzer Rule PSAlignAssignmentStatement 247ms (110ms|137ms)
ValidationMetadataException: The argument is null. Provide a valid value for the argument, and then try running the command again.
ParameterBindingValidationException: Cannot validate argument on parameter 'Path'. The argument is null. Provide a valid value for the argument, and then try running the command again.
at <ScriptBlock>, C:\projects\pstoggl\PSToggl\PSToggl.Tests.ps1:15
[-] General code style compliance.Module 'C:\projects\pstoggl\.codecovio\CodeCovIo.psm1'.passes the PSScriptAnalyzer Rule PSAvoidUsingCmdletAliases 12ms (9ms|3ms)
ValidationMetadataException: The argument is null. Provide a valid value for the argument, and then try running the command again.
ParameterBindingValidationException: Cannot validate argument on parameter 'Path'. The argument is null. Provide a valid value for the argument, and then try running the command again.
at <ScriptBlock>, C:\projects\pstoggl\PSToggl\PSToggl.Tests.ps1:15
And
Should : Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4
At C:\projects\pstoggl\Tests\PSToggl\Private\ConvertTo-TogglTask.Tests.ps1:40 char:37
+ {$out.ToString()} | Should Not Throw
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Should
Solution
Migrate to Pester 5.x
This basically involves:
Changing invocation in AppVeyor/Test.ps1
Remove version parameter from Install-Module in AppVeyor/Install.ps1
Assert-MockCalled should be replaced with Should -Invoke
You might want to take a look at the migration guide.
Quickfix until then:
Fix version to <=4.9.9 in AppVeyor/Install.ps1
Possible improvements:
While the coverage is overall quite ok, there is room for improvement for test structure in general.
The text was updated successfully, but these errors were encountered:
In order to get Pester 5 running, several changes are required.
Variables have to be passed by -TestCases, `Should` Verbs are parameters
and so on
Relates to #9
Current behaviour:
Build fails, because the whole testing setup is made for Pester <4.9.x, and the Install-Script for AppVeyor installs the latest Pester-version (5.0.x)
Error:
And
Solution
Migrate to Pester 5.x
This basically involves:
Assert-MockCalled
should be replaced withShould -Invoke
Quickfix until then:
Fix version to
<=4.9.9
inAppVeyor/Install.ps1
Possible improvements:
While the coverage is overall quite ok, there is room for improvement for test structure in general.
The text was updated successfully, but these errors were encountered: