Skip to content

Improve Pester Expected Throw Message in Example #2971

Closed

Description

In WritingPesterTests.md, it should provide a more descriptive message, such as

it "Get-Item on a nonexisting file should have error PathNotFound" {
    try
    {
        get-item "ThisFileCannotPossiblyExist" -ErrorAction Stop
        throw "Expected an exception throw, but no Exception was thrown."
    }
    catch
    {
        $_.FullyQualifiedErrorId | should be "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand"
    }
}

Activity

  1. mirichmo commented on Feb 15, 2017

    @mirichmo
    MemberAuthor

    I'm closing this since I abandoned the merge since no change is required.

  2. added
    Resolution-Won't Fix
    on Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Resolution-Won't Fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions