From fb5f4aa972be85d91567b5d54cacf95c962ae8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Sat, 22 Aug 2026 14:08:13 +0200 Subject: [PATCH] Use the term "soft assertions" on the v5 Should page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The word did not appear anywhere in the v5 docs, so searching pester.dev for it missed the page that actually describes the behavior. The v6 docs got a dedicated page in #397, this just makes the v5 one findable and mentions -ErrorAction Stop for guarding a precondition. Part of #385. 🤖 --- versioned_docs/version-v5/assertions/should-command.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/versioned_docs/version-v5/assertions/should-command.mdx b/versioned_docs/version-v5/assertions/should-command.mdx index 6ed5c677..849353d5 100644 --- a/versioned_docs/version-v5/assertions/should-command.mdx +++ b/versioned_docs/version-v5/assertions/should-command.mdx @@ -26,11 +26,11 @@ But was: 'Pester is bad.' Other assertion types can be found in [Assertion Reference](.). -### Collect all Should failures +### Collect all Should failures (soft assertions) -`Should` can now be configured to continue on failure. This will report the error to Pester, but won't fail the test immediately. Instead, all the Should failures are collected and reported at the end of the test. This allows you to put multiple assertions into one It and still get complete information on failure. +`Should` can now be configured to continue on failure. This will report the error to Pester, but won't fail the test immediately. Instead, all the Should failures are collected and reported at the end of the test. This allows you to put multiple assertions into one It and still get complete information on failure. This is known as a **soft assertion**. -This new Should behavior is opt-in and can be enabled via `Should.ErrorAction = 'Continue'` on the configuration object or via `$PesterPreference`. +This new Should behavior is opt-in and can be enabled via `Should.ErrorAction = 'Continue'` on the configuration object or via `$PesterPreference`. Setting `-ErrorAction Stop` on a single assertion makes that one fail the test immediately even when soft assertions are enabled, which is useful to guard a precondition. ```powershell BeforeAll {