Skip to content

ShowStartMarkers is missing data driven replacements #2635

Open
@davidmatson

Description

@davidmatson

Checklist

What is the issue?

I wanted to add a new PTest for this case, but I can't find the right implementation to make the test pass.

        t 'Test names are evaluated after data driven replacements when when ShowStartMarkers is enabled' {
            $sb = {
                $PesterPreference = [PesterConfiguration]::Default
                $PesterPreference.Output.Verbosity = 'Detailed'
                $PesterPreference.Debug.ShowStartMarkers = $true
                $PesterPreference.Output.CIFormat = 'None'
                $PesterPreference.Output.RenderMode = 'ConsoleColor'

                $container = New-PesterContainer -ScriptBlock {
                    Describe 'd1' {
                        It 'Iteration <_>' -ForEach (@(1..3)) {
                            1 | Should -Be 1
                        }
                    }
                }
                Invoke-Pester -Container $container
            }

            $output = Invoke-InNewProcess $sb
            # only print the relevant part of output
            $null, $run = $output -join "`n" -split 'Running tests.'
            $run | Write-Host

            $i1Start = $output | Select-String -Pattern '\[\|\] Iteration 1\.\.\.$'
            @($i1Start).Count | Verify-Equal 1
            $i1Start = $output | Select-String -Pattern '\[\|\] Iteration 2\.\.\.$'
            @($i2Start).Count | Verify-Equal 1
            $i1Start = $output | Select-String -Pattern '\[\|\] Iteration 3\.\.\.$'
            @($i3Start).Count | Verify-Equal 1
        }

I think that currently there is no Plugin step after the expansion is done, and fixing this bug would require creating a new Plugin step, or something like that, but I may be mistaken. @nohwnd @fflaten - thoughts?

Expected Behavior

Test name includes expansions

Steps To Reproduce

see snippet above

Describe your environment

No response

Possible Solution?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions