Skip to content

If Describe block in Pester test is lowercased then the 'Run tests/Debug tests' code lense does not appear #822

Closed
@bergmeister

Description

@bergmeister

Given the following foo.tests.ps1 file:

describe "foo" {
    It "bar" {
        
    }
}

The VS-Code extension does not show the code lens shows Run tests/Debug tests only if the describe keyword starts with an upper case, Pester does not require that. Using the latest version of the PowerShell extension (1.10.1) and code-insiders 1.31.0

image

image

image

I suspect that PesterKeywords.TryGetValue(commandName, out pesterCommandType) below is case sensitive, the dictionary should be initialized using StringComparer.OrdinalIgnoreCase
https://github.com/PowerShell/PowerShellEditorServices/blob/master/src/PowerShellEditorServices/Symbols/PesterDocumentSymbolProvider.cs#L203

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