Skip to content

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

Description

@indented-automation

Describe "Koan Bug, Issue, or Help Request"

  • AboutAssignmentAndArithmetic

Context "The Problematic Assertions"

  • Subtraction\cannot be used with strings
  • Modulus\cannot be used on non-numeric values

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: pester/Pester#1793

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions