Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pester 4.02] Bug in output where multiple Paths are passed in to -Scripts at Invoke-Pester #710

Closed
BrianFarnhill opened this issue Jan 27, 2017 · 1 comment
Assignees
Milestone

Comments

@BrianFarnhill
Copy link

If you call Invoke-Pester with an array of hashtables passed to the -Scripts parameter like this:

@(
    @{
        'Path' = "C:\path1"
        'Parameters' = @{ "Param" = "value 1" }
    },
    @{
        'Path' = "C:\path1"
        'Parameters' = @{ "Param" = "value 2" }
    },
    @{
        'Path' = "C:\path2"
        'Parameters' = @{ "Param" = "value" }
    }
)

The output that you see at the start of the test run looks like this below:

Executing all tests in System.Collections.Hashtable', 'System.Collections.Hashtable', 'System.Collections.Hashtable

The tests all still execute as they should, it's just that first line out output that is looking at the objects and not the Path property in each.

To that end, could we do something with the output here to include the parameters as well? In the case of what I'm doing I'm actually running the tests in a single directory multiple times, but shifting the parameters on each (to point to a different stub module each time). So something more meaningful here would be useful.

@nohwnd
Copy link
Member

nohwnd commented Jan 27, 2017

Thanks.

The same issue is already reported in #699.

Yes the output can be made better. Please report it as a new issue so I can add it to 4.1 milestone.

JPRuskin added a commit to JPRuskin/Pester that referenced this issue Jul 14, 2017
Fix for:
 - Unexpected output when passing hashtable to Invoke-Pester pester#699
 - Bug in output where multiple Paths are passed in to -Scripts at Invoke-Pester pester#710

Changes:
 - Simply tests if there is a path property, if so uses it for the message formatting. Otherwise, falls back to original method.
 - `-join ', '` was used to provide consistency with current messages, as the default ("', '") has no bracketing quotes.
@nohwnd nohwnd added this to the V4 milestone Jul 25, 2017
@nohwnd nohwnd self-assigned this Aug 12, 2017
nohwnd added a commit that referenced this issue Aug 12, 2017
Added formatting function and tests, did only basic testing because the Write-Host cannot be mocked in Write-PesterStart and I don't want to dig too deep into the code.

Fix #699 
Fix #710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants