how to run Pester quickly with -OutPut Detailed in VSCode?
Asked Answered
P

1

5

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?

Proa answered 23/12, 2020 at 0:43 Comment(0)
B
7

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'
Britishism answered 23/12, 2020 at 8:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.