Press the shortcut key 'Ctrl+F5' in VSCode to run the Pester test file with the suffix '.tests.ps1'.
In 'about_Parsing.Tests.ps1' After you press "Ctrl+F5", the console will directly appear:d:\GitRepository\PowerShell\example\pester\about_Parsing\about_Parsing.Tests.ps1
The test is then run directly.
How to run tests in such a convenient way and use various invoke-pester
parameters, such as -output detailed
?
If you go to the Settings of VSCode and search for Pester, you should find a setting called:
PowerShell > Pester: Output Verbosity
You can set this to "detailed".
The setting also indicates that if you're using Pester v5 or newer you can also set this via the $PesterPreference
variable which it uses by default. You could set this variable in your script or PowerShell profile.
$PesterPreference = [PesterConfiguration]::Default
$PesterPreference.Output.Verbosity = 'Detailed'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.