Skip to content

Releases: pester/Pester

5.6.0-rc1

17 May 19:38
Compare
Choose a tag to compare
5.6.0-rc1 Pre-release
Pre-release

What's Changed

Inconclusive is back!

  • Set-ItResult: Return distinctive ErrorId depending on switch used by @csandfeld in #2401
  • Handle tests marked as inconclusive by @csandfeld in #2405
  • Add missing help for -Skip in Context and Describe by @fflaten in #2426

Should -HaveParameter regression is fixed.

  • Fix Should -HaveParamter -DefaultValue by @nohwnd in #2398

And more:

(in beta1)

(in rc1)

  • Standardize container name and type validation by @fflaten in #2379
  • Fix WildcardPatternException when using dt in P by @fflaten in #2443
  • Fix possible NRE in NUnit3 export by @fflaten in #2444
  • Skip blocks without runnable tests by @fflaten in #2447
  • Ignore excluded/skipped tests and unnecessary setup/teardown using SkipRemainingOnFailure by @fflaten in #2442

New Contributors

And also a big thank you to @fflaten!

Contrary to my tweet, we won't remove support for 3, 4, and 6.2 in Pester 5, the PR was added and then reverted. Will keep that change for Pester 6.

  • Drop support of PowerShell 3, 4, 6.2, and unsupported 7 by @nohwnd in #2432
  • Revert dropping support of Powershell 3 and friends by @nohwnd in #2435

Error on update:

My certificate was renewed, and you will get error on update, because the Issuer changed. And there is no way to get valid certificate from the previous issuer. It is still signed by me, but don't take my word for it, go check the certificate.

image

Full Changelog: 5.6.0-beta1...5.6.0-rc1

5.6.0-beta1

25 Apr 19:29
Compare
Choose a tag to compare
5.6.0-beta1 Pre-release
Pre-release

What's Changed

Inconclusive is back!

  • Set-ItResult: Return distinctive ErrorId depending on switch used by @csandfeld in #2401
  • Handle tests marked as inconclusive by @csandfeld in #2405
  • Add missing help for -Skip in Context and Describe by @fflaten in #2426

Should -HaveParameter regression is fixed.

  • Fix Should -HaveParamter -DefaultValue by @nohwnd in #2398

And more:

New Contributors

And also a bit thank you to @fflaten!

Contrary to my tweet, we won't remove support for 3, 4, and 6.2 in Pester 5, the PR was added and then reverted. Will keep that change for Pester 6.

  • Drop support of PowerShell 3, 4, 6.2, and unsupported 7 by @nohwnd in #2432
  • Revert dropping support of Powershell 3 and friends by @nohwnd in #2435

Error on update:

My certificate was renewed, and you will get error on update, because the Issuer changed. And there is no way to get valid certificate from the previous issuer. It is still signed by me, but don't take my word for it, go check the certificate.

image

Full Changelog: 5.5.0...5.6.0-beta1

5.5.0

27 Jun 16:10
Compare
Choose a tag to compare

What's Changed

  • Add support for NUnit3 XML-reports by @fflaten in #2208
  • Add -InParameterSet in Should -HaveParameter by @fflaten in #2273
  • CI Treat Errors As Warnings - ref #2295 by @erikgraa in #2296
  • Add missing container-parameters to Data before BeforeDiscovery by @fflaten in #2361
  • Fix ANSI sequence shown in Azure DevOps summary by @fflaten in #2352
  • Support Should -HaveParameter -DefaultValue for AliasInfo and scripts by @fflaten in #2353
  • Update error messages in Should -Throw by @fflaten in #2354
  • Fix parameter default values leaking to Data in user-provided Container by @fflaten in #2362
  • Rename TestCases parameter to ForEach by @nohwnd in #2311

Pester in Pester

  • Do not cleanup previous mocks in inner Invoke-Pester by @fflaten in #2337
  • Reattach TestDrive and TestRegistry after running inner Invoke-Pester by @fflaten in #2341

Perf

Internal fixes

  • Support building assembly with Debug configuration by @fflaten in #2339
  • Address analyzer suggestions for csharp-project by @fflaten in #2307
  • Add Run.Exit option clarification by @nohwnd in #2346
  • Fix false errors and broken CI-logs from P-tests by @fflaten in #2345
  • Upgrade to action/checkout v3 in PSSA workflow by @fflaten in #2351
  • Change sponsoring in readme by @nohwnd in #2363
  • Refactor Invoke-Pester and validate configuration early by @fflaten in #2317
  • Reorganize TestResuls-code into format-specific files by @fflaten in #2348

New Contributors

Full Changelog: 5.4.1...5.5.0

5.5.0-rc1

16 Jun 12:24
Compare
Choose a tag to compare
5.5.0-rc1 Pre-release
Pre-release

What's Changed

  • Add support for NUnit3 XML-reports by @fflaten in #2208
  • Add -InParameterSet in Should -HaveParameter by @fflaten in #2273
  • CI Treat Errors As Warnings - ref #2295 by @erikgraa in #2296
  • Avoid nested array when using Should -ActualValue by @fflaten in #2315
  • Add missing container-parameters to Data before BeforeDiscovery by @fflaten in #2361
  • Fix ANSI sequence shown in Azure DevOps summary by @fflaten in #2352
  • Support Should -HaveParameter -DefaultValue for AliasInfo and scripts by @fflaten in #2353
  • Update error messages in Should -Throw by @fflaten in #2354
  • Fix parameter default values leaking to Data in user-provided Container by @fflaten in #2362
  • Rename TestCases parameter to ForEach by @nohwnd in #2311

Pester in Pester

  • Do not cleanup previous mocks in inner Invoke-Pester by @fflaten in #2337
  • Reattach TestDrive and TestRegistry after running inner Invoke-Pester by @fflaten in #2341

Perf

Internal fixes

  • Support building assembly with Debug configuration by @fflaten in #2339
  • Address analyzer suggestions for csharp-project by @fflaten in #2307
  • Add Run.Exit option clarification by @nohwnd in #2346
  • Fix false errors and broken CI-logs from P-tests by @fflaten in #2345
  • Upgrade to action/checkout v3 in PSSA workflow by @fflaten in #2351
  • Change sponsoring in readme by @nohwnd in #2363
  • Refactor Invoke-Pester and validate configuration early by @fflaten in #2317
  • Reorganize TestResuls-code into format-specific files by @fflaten in #2348

New Contributors

Full Changelog: 5.4.1...5.5.0-rc1

5.4.1

05 Apr 12:17
36b3164
Compare
Choose a tag to compare

What's Changed

Fixes

  • Fix Format-Collection for ICollection by @fflaten in #2265
  • Improve error when -HaveParameter is used with mock or alias for local function by @fflaten in #2233
  • HaveParameter is not dependent on format of param block by @brianwest in #2288
  • Fix script parameter leaking to another container with same Data by @fflaten in #2302
  • Include expected type in exceptions when type is not resolvable by @fflaten in #2271
  • Measure AfterAll and AfterEach as UserDuration by @fflaten in #2313
  • Update New-MockObject help by @fflaten in #2323
  • Fix docs typos by @martincostello in #2326
  • Replace ErrorAction SilentlyContinue with Ignore by @fflaten in #2318
  • Quote input string in BeNullOrEmpty error by @fflaten in #2329
  • Remove parameter attributes in reverse in Mock by @fflaten in #2334
  • Support profiling Pester with CC using Profiler v3.1 or v4 by @fflaten in #2321

Performance

  • Make initial Mock cleanup more performant by @nohwnd in #2332

Internal fixes

New Contributors

Full Changelog: 5.4.0...5.4.1

5.4.0

10 Jan 17:03
Compare
Choose a tag to compare

In this release there are many fixes and improvements thanks @fflaten to providing most of them!

ANSI colors for output

Output is now printed with colors in AzureDevOps:

image

To achieve that, Pester detects if the host supports ANSI codes and uses them to output the string. You can control this by this new option:

[PesterConfiguration]::Default.Output.RenderMode

Default Description                                                                                 Value
------- -----------                                                                                 -----
Auto    The mode used to render console output, options are Auto, Ansi, ConsoleColor and Plaintext. Auto

And optionally switch back to classical ConsoleColor, or a new PlainText mode that outputs just text without any embedded formatting.

Check Multiple aliases for Should -HaveParameter

Should -HaveParameter can now ensure that there are multiple aliases set for a parameter.

function f { 
    param( [Alias('UserName')] $Name ) 

    $Name     
}


Get-Command f | Should -HaveParameter Name -Alias 'n', 'UserName'

InvalidResult:
Line |
   1 | Get-Command f | Should -HaveParameter Name -Alias 'n', 'UserName'
     | Expected command f to have a parameter Name, with aliases 'n' and 'UserName', 
     | but it didn't have an alias 'n'.
  • Add support for multiple aliases (-Alias) to Should -HaveParameter by @dtewinkel in #2247

Always return to the original path

Pester captures the current path in which Invoke-Pester is invoked, and returns to this path after the execution of the test, even if the tests change it:

PS C:\projects\myModule> Invoke-Pester -Container (
    New-PesterContainer -ScriptBlock {
        Describe "d" {
            It "i" {
                Set-Location C:\Windows
            } 
        } 
    })

This will return back to C:\projects\myModule after your tests finish running.

  • Always return to original CWD after running Pester by @fflaten in #2189

Mocking in Manifest Modules

Mock, Should -Invoke and InModuleScope are now allowed for manifest modules.

  • Support mocking and execution in manifest modules by @fflaten in #2234

Additional changes and improvements

  • Add Should-example for exception-assertion by @fflaten in #2171

  • Updates to comment help and examples by @fflaten in #2196

  • Fix mocks with enum-parameters and ValidateRange by @fflaten in #2191

  • Don't run Get-CimInstance on Nanoserver by @irishismyname in #2192

  • Exit invoked testfile after interactive execution by @fflaten in #2218

  • Add ANSI support for output by @fflaten in #2199

  • Fix hang in New-TestRegistry when access is denied by @fflaten in #2236

  • Add support for assigning lists to StringArrayOption by @fflaten in #2232

  • Throw in Add-ShouldOperator when max number of operators is reached by @fflaten in #2231

  • Validate Should -Invoke is invoked in specified -Scope blocktype by @fflaten in #2230

  • Add -Because to Should -Invoke and -InvokeVerifiable by @fflaten in #2229

  • Fix NRE when assigning null to arrayoption in hashtable by @fflaten in #2219

  • Fix module installation in PowerShell 3 and 4 by @fflaten in #2214

  • Add help for dynamic operator parameters by @fflaten in #2170

  • Fix broken assertions link in help by @fflaten in #2205

  • Support int and double values when merging decimaloption by @fflaten in #2186

  • Update ExpandedPath before executing tests and blocks by @fflaten in #2254

Internal fixes and improvements

  • Bump Ubuntu 18.04 to 22.04 in CI test stage by @fflaten in #2252
  • Bump macOS 10.15 to 12 in CI test stage by @fflaten in #2253
  • Reorg Add-ShouldOperator P-tests to avoid 32 operator limit by @fflaten in #2248
  • Update CI build image and PesterTests to .NET 6 by @fflaten in #2249
  • Cache nugets in CI by @nohwnd in #2204
  • Use latest C# language version by @nohwnd in #2250
  • Cleanup remaining testcase param-blocks in tests by @fflaten in #2226
  • Use Start plugin-step for TestDrive and TestRegistry PSDrive cleanup by @fflaten in #2237
  • Fix support for PowerShell 6.0.4 by @fflaten in #2215
  • Sign format files by @nohwnd in #2212
  • Replace IsOriginalValue() with IsModified and fix merging and casting of default option values by @fflaten in #2201
  • Start interactive execution from BeforeDiscovery by @fflaten in #2217
  • Add GitHub Action to run PSScriptAnalyzer on PR and commit by @fflaten in #2221
  • Replace alias and positional parameter usage in Coverage.ps1 by @fflaten in #2225
  • Add -NoBuild for P-tests by @fflaten in #2200
  • Update issue templates to forms syntax by @fflaten in #2176
  • Update issue form templates by @fflaten in #2180
  • Exclude docs and support files from triggering CI by @fflaten in #2184
  • Minor improvements to build script by @fflaten in #2183
  • Remove v4 param-blocks from HaveParameter tests by @fflaten in #2224

New Contributors

Full Changelog: 5.3.3...5.4.0

5.4.0-rc1

06 Nov 10:50
Compare
Choose a tag to compare
5.4.0-rc1 Pre-release
Pre-release

In this release there are many fixes and improvements thanks @fflaten to providing most of them!

ANSI colors for output

Output is now printed with colors in AzureDevOps:

image

To achieve that, Pester detects if the host supports ANSI codes and uses them to output the string. You can control this by this new option:

[PesterConfiguration]::Default.Output.RenderMode

Default Description                                                                                 Value
------- -----------                                                                                 -----
Auto    The mode used to render console output, options are Auto, Ansi, ConsoleColor and Plaintext. Auto

And optionally switch back to classical ConsoleColor, or a new PlainText mode that outputs just text without any embedded formatting.

Check Multiple aliases for Should -HaveParameter

Should -HaveParameter can now ensure that there are multiple aliases set for a parameter.

function f { 
    param( [Alias('UserName')] $Name ) 

    $Name     
}


Get-Command f | Should -HaveParameter Name -Alias 'n', 'UserName'

InvalidResult:
Line |
   1 | Get-Command f | Should -HaveParameter Name -Alias 'n', 'UserName'
     | Expected command f to have a parameter Name, with aliases 'n' and 'UserName', 
     | but it didn't have an alias 'n'.
  • Add support for multiple aliases (-Alias) to Should -HaveParameter by @dtewinkel in #2247

Always return to the original path

Pester captures the current path in which Invoke-Pester is invoked, and returns to this path after the execution of the test, even if the tests change it:

PS C:\projects\myModule> Invoke-Pester -Container (
    New-PesterContainer -ScriptBlock {
        Describe "d" {
            It "i" {
                Set-Location C:\Windows
            } 
        } 
    })

This will return back to C:\projects\myModule after your tests finish running.

  • Always return to original CWD after running Pester by @fflaten in #2189

Mocking in Manifest Modules

Mock, Should -Invoke and InModuleScope are now allowed for manifest modules.

  • Support mocking and execution in manifest modules by @fflaten in #2234

Additional changes and improvements

  • Add Should-example for exception-assertion by @fflaten in #2171

  • Updates to comment help and examples by @fflaten in #2196

  • Fix mocks with enum-parameters and ValidateRange by @fflaten in #2191

  • Don't run Get-CimInstance on Nanoserver by @irishismyname in #2192

  • Exit invoked testfile after interactive execution by @fflaten in #2218

  • Add ANSI support for output by @fflaten in #2199

  • Fix hang in New-TestRegistry when access is denied by @fflaten in #2236

  • Add support for assigning lists to StringArrayOption by @fflaten in #2232

  • Throw in Add-ShouldOperator when max number of operators is reached by @fflaten in #2231

  • Validate Should -Invoke is invoked in specified -Scope blocktype by @fflaten in #2230

  • Add -Because to Should -Invoke and -InvokeVerifiable by @fflaten in #2229

  • Fix NRE when assigning null to arrayoption in hashtable by @fflaten in #2219

  • Fix module installation in PowerShell 3 and 4 by @fflaten in #2214

  • Add help for dynamic operator parameters by @fflaten in #2170

  • Fix broken assertions link in help by @fflaten in #2205

  • Support int and double values when merging decimaloption by @fflaten in #2186

  • Update ExpandedPath before executing tests and blocks by @fflaten in #2254

Internal fixes and improvements

  • Bump Ubuntu 18.04 to 22.04 in CI test stage by @fflaten in #2252
  • Bump macOS 10.15 to 12 in CI test stage by @fflaten in #2253
  • Reorg Add-ShouldOperator P-tests to avoid 32 operator limit by @fflaten in #2248
  • Update CI build image and PesterTests to .NET 6 by @fflaten in #2249
  • Cache nugets in CI by @nohwnd in #2204
  • Use latest C# language version by @nohwnd in #2250
  • Cleanup remaining testcase param-blocks in tests by @fflaten in #2226
  • Use Start plugin-step for TestDrive and TestRegistry PSDrive cleanup by @fflaten in #2237
  • Fix support for PowerShell 6.0.4 by @fflaten in #2215
  • Sign format files by @nohwnd in #2212
  • Replace IsOriginalValue() with IsModified and fix merging and casting of default option values by @fflaten in #2201
  • Start interactive execution from BeforeDiscovery by @fflaten in #2217
  • Add GitHub Action to run PSScriptAnalyzer on PR and commit by @fflaten in #2221
  • Replace alias and positional parameter usage in Coverage.ps1 by @fflaten in #2225
  • Add -NoBuild for P-tests by @fflaten in #2200
  • Update issue templates to forms syntax by @fflaten in #2176
  • Update issue form templates by @fflaten in #2180
  • Exclude docs and support files from triggering CI by @fflaten in #2184
  • Minor improvements to build script by @fflaten in #2183
  • Remove v4 param-blocks from HaveParameter tests by @fflaten in #2224

New Contributors

Full Changelog: 5.3.3...5.4.0-rc1

5.3.3

29 Apr 09:46
c79a6fa
Compare
Choose a tag to compare

Issues Fixed

  • Fix container failure output #2167

  • Test on less legacy systems #2164
  • Fix discord link in readme #2165

5.3.2

22 Apr 21:41
Compare
Choose a tag to compare

Issues Fixed

  • fix ForEach casing in Context #2111
  • Fix duplicate key exception in Should-InvokeInternal debug logging #2130
  • Adds default parameter set to New-MockObject #2160
  • Update help for New-Fixture #2097

  • Add discord-link and cleanup README #2102
  • Update devcontainer to NET 6.0 SDK and Powershell 7.2 #2116
  • Use newer images in our pipeline #2141

5.3.1

21 Sep 09:57
Compare
Choose a tag to compare

5.3.1

Issues Fixed

  • Bump 5.3.1
  • Fix Profiler code coverage in all loops #2081
  • fix accidental path input in interactive execution #2078
  • Fix mock object with 2 and more methods #2068

See full log here