
A no-inherit comment at the top of a folder's Pester.BeforeContainer.ps1 stops the chain there, so no setup file above that folder applies to it. Same meaning root = true has in editorconfig. New in 6.2. #pspester #powershell

PowerShell BDD and TDD testing framework. Includes tools for function testing, module testing, mocking, code coverage and more.

A no-inherit comment at the top of a folder's Pester.BeforeContainer.ps1 stops the chain there, so no setup file above that folder applies to it. Same meaning root = true has in editorconfig. New in 6.2. #pspester #powershell

Run.Parallel needed ForEach-Object -Parallel, a PowerShell 7 cmdlet, so Windows PowerShell 5.1 ran sequentially. Pester 6.2 uses the runspace pool API both editions ship, so 5.1 runs parallel. Experimental. #pspester #powershell

BeforeAll threw and Pester blamed a break or continue statement escaping your code? In 6.1 the real exception was discarded. In 6.2 you get the error that actually threw, with the line it came from. #pspester #powershell

In 6.2 every folder down to your test file can have its own Pester.BeforeContainer.ps1, applied outermost first, so tests/unit and tests/integration each add their own setup on top of the shared root one. #pspester #powershell

In 6.2 top level code in Pester.BeforeContainer.ps1 runs during discovery only. To reach your tests it has to sit inside BeforeAll, the same rule your test files follow. Wrap a bare Import-Module or it is not there. #pspester #powershell

A dead worker in a parallel run takes its whole test file with it. Pester 6.2 checks that every file came back and fails the run, naming the one that did not. Before, the suite went green one file short. #pspester #powershell

A second BeforeAll in the same block threw in 6.1. In 6.2 a block takes as many BeforeAll and AfterAll as you want, setups running in the order you wrote them and teardowns in reverse. #pspester #powershell

Your Pester.BeforeContainer.ps1 silently not applying? In 6.1 Pester found the repo root from the process working directory, which Set-Location does not change. In 6.2 it starts from where your session is. #pspester #powershell

Run.Parallel works on Windows PowerShell 5.1, not just PowerShell 7. It was built on ForEach-Object -Parallel, both editions go through a runspace pool now. 5.1 is the slowest edition, so it is the one that needed it most. github.com/pester/Pester/rel… #pspester #powershell

An error thrown from inside Pester lost its whole stack trace and printed no location at all. A BeforeAll that failed because a database was down reported an escaped break statement instead. Failures point at the line that caused them now. #pspester #powershell

A configuration value of the wrong type used to be ignored, so the run quietly did not do what you asked. Run.Parallel = 'yes' throws now, and a misspelled key gets a warning that names it. Values from JSON and psd1 arrive as strings, so this bit often. #pspester #powershell

Should-BeString prints a real diff. It used to put a caret under the first character that differed, so comparing a snapshot or a rendered config meant fixing one difference per run. It finds every region that differs now and prints them with context. #pspester #powershell

Pester 6.2.0 is out. Setup files follow your folders now. Every Pester.BeforeContainer.ps1 from the repo root down to the test file's own folder applies, outermost first, so unit tests and integration tests can each have their own setup. #pspester #powershell

Pester 6 catches a classic bug: -ForEach with an empty array used to skip silently. Now it fails discovery, so tests that never ran do not look green. Opt out with -AllowNullOrEmptyForEach. #pspester #powershell

Pester 6: assert on speed. { Start-Sleep -Milliseconds 100 } | Should-BeFasterThan 1s. Time literals like 1s and 50ms just work, and Should-BeSlowerThan is the opposite. #pspester #powershell

Pester 6: check your function's public contract. Get-Command My-Func | Should-HaveParameter Name -Type ([string]) -Mandatory. It reads the real parameter metadata: type, mandatory, default, alias, set. #pspester #powershell