Skip to content

Commit 9a163cb

Browse files
authored
Update VSCode page (#315)
* Update VSCode page * Include navigation features in VSCode * Fix typos * Use list for navigation features * Copy to v5 docs
1 parent b197ce2 commit 9a163cb

File tree

8 files changed

+47
-18
lines changed

8 files changed

+47
-18
lines changed
13.3 KB
Loading

docs/usage/images/vscode-outline.png

6.07 KB
Loading

docs/usage/images/vscode-symbol.png

2.42 KB
Loading

docs/usage/vscode.mdx

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
11
---
2-
title: VSCode
2+
title: Visual Studio Code
33
description: See how Visual Studio Code and its extensions helps you run and debug your Pester tests directly inside the editor
44
---
55

6-
### VSCode improvements
6+
Using Visual Studio Code with the latest [PowerShell extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) provides a great experience for writing PowerShell code. The extension includes Pester-specific features to improve the way you write, run and debug Pester tests.
77

8-
#### Use legacy code lens
8+
### Code lens
99

10-
With Pester 5 it is finally possible to run and debug just a single test in VSCode!
10+
With the `Pester: Code Lens` setting enabled, VSCode will show `Run tests` or `Debug tests` links above your Pester blocks for quick execution. Starting with Pester 5 this also works on individual tests. You can even run tests that are marked as skipped by running them individually.
1111

1212
![Shows a single test being run using the new Code Lens](images/single-test.gif)
1313

14-
In the latest [PowerShell](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) extension for VSCode you can enable Use Legacy Code Lens option which will enable `Run tests` on all `Describe`, `Context` and `It` blocks. You can run a whole block, any child block, or any test individually. You can also run tests that are marked as skipped by running them individually.
14+
To enable the improved code lens for Pester 5 you need to disable the "Use Legacy Code Lens" setting which is enabled by default.
1515

16-
Actually there is a bug, and the option is called Enable Legacy Code Lens, and is enabled by default and should be disabled for Pester 5. 😁 Take advantage of this and go try it right now!
16+
1. In Visual Studio Code, open **File | Preferences | Settings** (<kbd>⌘/Ctrl</kbd> + <kbd>,</kbd>)
17+
2. In the **Settings** window, navigate to the **Extensions | PowerShell** section.
18+
3. Uncheck the **Pester: Use Legacy Code Lens** checkbox.
19+
4. Close the **Settings** window.
1720

18-
**Instructions:** In Visual Studio Code, select **File | Preferences | Settings** (or type **Ctrl+,**). In the **Settings** window, under the **User** tab, select **Extensions | PowerShell Configuration**. Uncheck the **Pester: Use Legacy Code Lens** checkbox. Close the **Settings** window.
21+
### Output verbosity
1922

23+
You can control the output verbosity level in VSCode output, or let it inherit from PesterPreference.
2024

21-
#### Output verbosity
25+
![Shows a run with normal preference that shows only errors](images/minimal-output.gif)
2226

23-
You can specify verbosity in VSCode, to see normal or detailed output, or to take it from PesterPreference. This also works for Pester 4!
27+
### Navigation
2428

25-
![Shows a run with normal preference that shows only errors](images/minimal-output.gif)
29+
Pester-blocks are recognized by the PowerShell-extension to simplify navigation in your test files.
30+
31+
- The Outline panle shows an overview of your Pester-blocks.<br/>
32+
![Shows a outline of Pester block structure in the sidepanel](images/vscode-outline.png)
33+
34+
- Your current location in easily identified using breadcrumbs or the sticky scroll features.<br/>
35+
![Shows nested blocks as sticky lines above the current line in the editor](images/vscode-breadcrumbs.png)
36+
37+
- `Context`, `Describe` and `It` blocks are all searchable using Go to symbol commands.<br/>
38+
![Shows a search result for Help is found-test using the Go To Symbol in Workspace command](images/vscode-symbol.png)
Loading
Loading
Loading
Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
---
2-
title: VSCode
2+
title: Visual Studio Code
33
description: See how Visual Studio Code and its extensions helps you run and debug your Pester tests directly inside the editor
44
---
55

6-
### VSCode improvements
6+
Using Visual Studio Code with the latest [PowerShell extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) provides a great experience for writing PowerShell code. The extension includes Pester-specific features to improve the way you write, run and debug Pester tests.
77

8-
#### Use legacy code lens
8+
### Code lens
99

10-
With Pester 5 it is finally possible to run and debug just a single test in VSCode!
10+
With the `Pester: Code Lens` setting enabled, VSCode will show `Run tests` or `Debug tests` links above your Pester blocks for quick execution. Starting with Pester 5 this also works on individual tests. You can even run tests that are marked as skipped by running them individually.
1111

1212
![Shows a single test being run using the new Code Lens](images/single-test.gif)
1313

14-
In the latest [PowerShell](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) extension for VSCode you can enable Use Legacy Code Lens option which will enable `Run tests` on all `Describe`, `Context` and `It` blocks. You can run a whole block, any child block, or any test individually. You can also run tests that are marked as skipped by running them individually.
14+
To enable the improved code lens for Pester 5 you need to disable the "Use Legacy Code Lens" setting which is enabled by default.
1515

16-
Actually there is a bug, and the option is called Enable Legacy Code Lens, and is enabled by default and should be disabled for Pester 5. 😁 Take advantage of this and go try it right now!
16+
1. In Visual Studio Code, open **File | Preferences | Settings** (<kbd>⌘/Ctrl</kbd> + <kbd>,</kbd>)
17+
2. In the **Settings** window, navigate to the **Extensions | PowerShell** section.
18+
3. Uncheck the **Pester: Use Legacy Code Lens** checkbox.
19+
4. Close the **Settings** window.
1720

18-
#### Output verbosity
21+
### Output verbosity
1922

20-
You can specify verbosity in VSCode, to see normal or detailed output, or to take it from PesterPreference. This also works for Pester 4!
23+
You can control the output verbosity level in VSCode output, or let it inherit from PesterPreference.
2124

2225
![Shows a run with normal preference that shows only errors](images/minimal-output.gif)
26+
27+
### Navigation
28+
29+
Pester-blocks are recognized by the PowerShell-extension to simplify navigation in your test files.
30+
31+
- The Outline panle shows an overview of your Pester-blocks.<br/>
32+
![Shows a outline of Pester block structure in the sidepanel](images/vscode-outline.png)
33+
34+
- Your current location in easily identified using breadcrumbs or the sticky scroll features.<br/>
35+
![Shows nested blocks as sticky lines above the current line in the editor](images/vscode-breadcrumbs.png)
36+
37+
- `Context`, `Describe` and `It` blocks are all searchable using Go to symbol commands.<br/>
38+
![Shows a search result for Help is found-test using the Go To Symbol in Workspace command](images/vscode-symbol.png)

0 commit comments

Comments
 (0)