vexx32 / PSKoans

A simple, fun, and interactive way to learn the PowerShell language through Pester unit testing.
GNU General Public License v3.0
1.73k stars 176 forks source link

AboutAssignmentAndArithmetic: ExpectedMessage and implicit character ranges in Pester 5 #460

Open indented-automation opened 3 years ago

indented-automation commented 3 years ago

Describe "Koan Bug, Issue, or Help Request"

Context "The Problematic Assertions"

Context "Your Attempts"

N/A

Context "Additional Information"

In both cases the tests rely on Should -Throw -ExpectedMessage. The current release of PSKoans prefers Pester 4.10.1 which treats -ExpectedMessage an a literal.

In Pester 5 this string supports wildcards, which in turn breaks use of types such as [System.Object[]] in an expected message string.

See also: https://github.com/pester/Pester/issues/1793

vexx32 commented 3 years ago

Oh, hm, never thought of that. That's... annoying. Does pester offer an opt-out for the wildcard behaviour? 😕