vscode-adapter icon indicating copy to clipboard operation
vscode-adapter copied to clipboard

Console.WriteLine hangs test execution

Open slaugaus opened this issue 9 months ago • 1 comments

Test execution gets stuck if the test uses [Console]::WriteLine to print something, unless it's JSON.

Demo:

Describe 'Pester Tests Extension' {
    It 'Is Fine With JSON' {
        [Console]::WriteLine('{"valid": "json"}')
    }

    It 'Is Fine With Write-Host' {
        Write-Host 'not json'
    }

    It 'Dislikes Console.WriteLine' {
        [Console]::WriteLine('not json')
    }
}

Executing it directly works: Image

If I execute it through the extension, execution gets stuck on the third test: Image

When I click Cancel Test Run (stop icon), I get this error: Image

slaugaus avatar Apr 22 '25 01:04 slaugaus