Despite the value of $PSBPreference.Test.Enabled, Pester tests are executed.
Expected Behavior
If $PSBPreference.Test.Enabled is set to $false then Pester tests should not be run.
Current Behavior
Pester tests are run regardless of the setting.
Possible Solution
I would have said that inside the Pester task there should be a check for the $PSBPreference.Test.Enabled value being $true. However there is a $pesterPreReqs scriptblock that is executed in the psakeFile.ps1 as a precondition but this is not being carried over to InvokeBuild (perhaps using an -If) which is where I believe the issue is.
Your Environment
Module version used: 0.3.0-beta
Operating System and PowerShell version: Windows 10, 6.1.1
Despite the value of
$PSBPreference.Test.Enabled
, Pester tests are executed.Expected Behavior
If
$PSBPreference.Test.Enabled
is set to$false
then Pester tests should not be run.Current Behavior
Pester tests are run regardless of the setting.
Possible Solution
I would have said that inside the Pester task there should be a check for the
$PSBPreference.Test.Enabled
value being$true
. However there is a$pesterPreReqs
scriptblock that is executed in thepsakeFile.ps1
as a precondition but this is not being carried over to InvokeBuild (perhaps using an-If
) which is where I believe the issue is.Your Environment