Skip to content

"Running tests from ..." is not displayed for ScriptBlock containers. #2639

@davidmatson

Description

@davidmatson

Checklist

What is the issue?

The output format when starting running a container is inconsistent for ScriptBlocks vs files.

Expected Behavior

The ScriptBlock name is displayed when starting to run tests in it.

Steps To Reproduce

$container = New-PesterContainer -ScriptBlock {
    Describe 'Some Tests' {
        It 'passes' {
        }

        It 'also passes' {
        }
    }
}
$configurationHashtable = @{
    Run    = @{ Container = $container };
    Output = @{ Verbosity = 'Detailed' };
    Debug  = @{ ShowNavigationMarkers = $true; ShowStartMarkers = $true }
}
$configuration = New-PesterConfiguration -Hashtable $configurationHashtable
Invoke-Pester -Configuration $configuration

vs

$configurationHashtable = @{
    Run    = @{ Path = "$PSScriptRoot\OtherFile.Tests.ps1" };
    Output = @{ Verbosity = 'Detailed' };
    Debug  = @{ ShowNavigationMarkers = $true; ShowStartMarkers = $true }
}
$configuration = New-PesterConfiguration -Hashtable $configurationHashtable
Invoke-Pester -Configuration $configuration

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