Skip to content

Commit c482cde

Browse files
nohwndCopilot
authored andcommitted
Default useLegacyCodeLens to false for Pester 5 CodeLens
Pester 4 has been EOL since 2020 and Pester 5 is the current stable. Default the CodeLens to the Pester 5 layout (`Run Tests` on `It`, `Describe` and `Context`) instead of the Pester 4 one (`Run Tests` on `Describe` only). Users who haven't touched the setting will see CodeLens on `It` and `Context` blocks too, and clicking them runs `InvokePesterStub.ps1` with `-MinimumVersion5`. On systems where only Pester 4 is installed the stub falls back to v4 and warns; tests still run but the line-level filter is a v5 feature. Set `powershell.pester.useLegacyCodeLens` back to `true` to restore the old default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent de01d8e commit c482cde

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,8 +1008,8 @@
10081008
"properties": {
10091009
"powershell.pester.useLegacyCodeLens": {
10101010
"type": "boolean",
1011-
"default": true,
1012-
"markdownDescription": "Use a CodeLens that is compatible with Pester 4. Disabling this will show `Run Tests` on all `It`, `Describe` and `Context` blocks, and will correctly work only with Pester 5 and newer."
1011+
"default": false,
1012+
"markdownDescription": "Use the legacy CodeLens compatible with Pester 4 (only shows `Run Tests` on `Describe` blocks). When disabled (the default), `Run Tests` is shown on all `It`, `Describe` and `Context` blocks for Pester 5 and newer."
10131013
},
10141014
"powershell.pester.codeLens": {
10151015
"type": "boolean",

‎src/features/PesterTests.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class PesterTestsFeature implements vscode.Disposable {
149149

150150
const useLegacyCodeLens = pesterConfig.get<boolean>(
151151
"useLegacyCodeLens",
152-
true,
152+
false,
153153
);
154154
if (!useLegacyCodeLens) {
155155
launchConfig.args.push("-MinimumVersion5");

0 commit comments

Comments
 (0)