Pester assert failed

Welcome Forums Pester Pester assert failed

Viewing 8 reply threads
  • Author
    Posts
    • #144974
      Participant
      Topics: 1
      Replies: 2
      Points: 1
      Rank: Member

      Hi experts,

      I’m writing a PowerShell function that imports System.Security.SecureString from the pre-exported ‘Standard Encrypted String’ and ‘Encryption Key’, and I ran into an issue when I was writing Pester test for it. Here is the simplified example:

      In this example, the first ‘It’ block passed and the second failed, how can I correctly assert the second one?

    • #145196
      Senior Moderator
      Topics: 9
      Replies: 1370
      Points: 5,048
      Helping Hand
      Rank: Community MVP

      Can you share the pester output for the failed test case.

    • #145238
      Participant
      Topics: 1
      Replies: 2
      Points: 1
      Rank: Member

      Hi kvprasoon,

      Here is the output:

      Also, if I replace the key with “123”, although the key length is invalid, the test will pass:

    • #145607
      Senior Moderator
      Topics: 9
      Replies: 1370
      Points: 5,048
      Helping Hand
      Rank: Community MVP

      not getting any clue here, will include Jakub here.

    • #146636
      Participant
      Topics: 1
      Replies: 2
      Points: 1
      Rank: Member

      Hi kvprasoon,

      Should I submit an issue to GitHub?

    • #146643
      Senior Moderator
      Topics: 9
      Replies: 1370
      Points: 5,048
      Helping Hand
      Rank: Community MVP

      That’ll be better.

    • #148865
      Participant
      Topics: 0
      Replies: 1
      Points: 7
      Rank: Member

      same problem i faced

    • #161505
      Participant
      Topics: 0
      Replies: 8
      Points: 46
      Helping Hand
      Rank: Member

      Can you share the pester output for the failed test case.

    • #161943
      Participant
      Topics: 0
      Replies: 28
      Points: -7
      Rank: Member

      Both tests pass on my computer (macOS / Pwsh 6.2.1 / Pester 4.8.1), can everybody else replicate it? What versions are you using?

Viewing 8 reply threads
  • The topic ‘Pester assert failed’ is closed to new replies.