Jakub Jareš

Pester - Using Because in tests

Read more

This weekend I added custom failure reasons into Pester. This feature I know and love from Fluent Assertions, so let me show you how I would use it in Pester.

🔥 This feature is not released yet, get pre-release version 4.2.0-alpha3 to use it.

Because parameter

The new feature adds an optional -Because parameter to all Should assertions. The parameter allows you to specify a reason that will be shown when assertion fails, like so: