Closed
Description
System Details
System Details Output
### VSCode version: 1.43.2 0ba0ca52957102ca3527cf479571617f0de6ed50 x64
### VSCode extensions:
[email protected]
### PSES version: 2.1.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Description
Whilst testing Preview-2020.3.2 with Enable Legacy Code Lens
enabled, I noticed that Run test | Debug test
appeared against each It
command. Also, when running tests, I got the following warning:
WARNING: Pester 5.0.0 or newer is required because setting PowerShell >
Pester: Enable Legacy Code Lens is disabled, but Pester 4.10.1 is loaded.
Some of the code lense features might not work as expected.
Here are my steps to reproduce the issue:
- Started Windows Sandbox
- Installed PowerShell:
PowerShell-7.0.0-win-x64.msi
- Installed Pester 4.10.1:
Install-Module pester -Scope CurrentUser
- Installed VS Code:
VSCodeUserSetup-x64-1.43.2.msi
- Add the following to
settings.json
:
{
"editor.fontSize": 11,
"terminal.integrated.fontSize": 11,
"extensions.ignoreRecommendations": true,
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false,
"powershell.developer.editorServicesLogLevel": "Diagnostic",
"powershell editor services.trace.server":"verbose",
"powershell.pester.enableLegacyCodeLens": true
}
- Installed PowerShell extension:
PowerShell-Preview-2020.3.2.vsix
- Closed VS Code
- Unzipped test project (Legacy Code Lens not working.zip) to a folder on the desktop
- Right clicked on folder and selected
Open with Code
- Opened
Test.Tests.ps1
- Checked settings
powershell.pester.enableLegacyCodeLens
was set totrue
Run test | Debug test
was available against allIt
commands- Clicking
Run tests
aboveDescribe
resulted in:
PS C:\Users\WDAGUtilityAccount\Desktop\Legacy Code Lens not working> .
'c:\Users\WDAGUtilityAccount\.vscode\extensions\ms-vscode.powershell-preview-2020.3.2\InvokePesterStub.ps1' -ScriptPath 'c:\Users\WDAGUtilityAccount\Desktop\Legacy Code Lens
not working\Test.Tests.ps1' -LineNumber 5 -TestName 'Test-Function' -MinimumVersion5
-Output 'FromPreference'
WARNING: Pester 5.0.0 or newer is required because setting PowerShell >
Pester: Enable Legacy Code Lens is disabled, but Pester 4.10.1 is loaded.
Some of the code lense features might not work as expected.
Pester v4.10.1
Executing all tests in 'c:\Users\WDAGUtilityAccount\Desktop\Legacy Code Lens not working\Test.Tests.ps1' matching test name c:\Users\WDAGUtilityAccount\Desktop\Legacy Code Lens not working\Test.Tests.ps1:5
Executing script c:\Users\WDAGUtilityAccount\Desktop\Legacy Code Lens not working\Test.Tests.ps1
Describing Test-Function
[+] dummyTest1 185ms
[+] dummyTest2 19ms
Tests completed in 1.03s
Tests Passed: 2, Failed: 0, Skipped: 0, Pending: 0, Inconclusive: 0
Note: The above tests ran, but only after I had manually imported Pester (4.10.1).
Expected Behaviour
Not to see Run test | Debug test
appeared against each It
command.
Not to see a warning about Pester 5.0.0.
Actual Behaviour
I see Run test | Debug test
appeared against each It
command.
I see a warning about Pester 5.0.0.