Skip to content

'Run tests|Debug tests' Pester code lens does not show when Describe block is interpolated string #827

Closed
@bergmeister

Description

@bergmeister

I sometimes include test details in the describe block that are sometimes only known at runtime, however, the Pester code lens does not show any more once I use an interpolated string in the Describe block.
Given the following Pester file (foo.tests.ps1):

$version = $PSVersionTable.PSVersion.Major
Describe "foo on PSVersion $version" {
	It "bar $version" {

	}
}

The Run tests|Debug tests code lens does not show, I see that under the hood, the extension creates parameters to Invoke-Pester that look like -PesterOption @{IncludeVSCodeMarker=$true} -TestName 'foo', in this case, the extension would either need to evaluate the interpolated string or just get rid of the -TestName parameter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions