diff --git a/docs/usage/images/vscode-breadcrumbs.png b/docs/usage/images/vscode-breadcrumbs.png new file mode 100644 index 00000000..e0a632c7 Binary files /dev/null and b/docs/usage/images/vscode-breadcrumbs.png differ diff --git a/docs/usage/images/vscode-outline.png b/docs/usage/images/vscode-outline.png new file mode 100644 index 00000000..7dbb3d44 Binary files /dev/null and b/docs/usage/images/vscode-outline.png differ diff --git a/docs/usage/images/vscode-symbol.png b/docs/usage/images/vscode-symbol.png new file mode 100644 index 00000000..37fa0173 Binary files /dev/null and b/docs/usage/images/vscode-symbol.png differ diff --git a/docs/usage/vscode.mdx b/docs/usage/vscode.mdx index 9ee5cae4..7f1bceea 100644 --- a/docs/usage/vscode.mdx +++ b/docs/usage/vscode.mdx @@ -1,25 +1,38 @@ --- -title: VSCode +title: Visual Studio Code description: See how Visual Studio Code and its extensions helps you run and debug your Pester tests directly inside the editor --- -### VSCode improvements +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. -#### Use legacy code lens +### Code lens -With Pester 5 it is finally possible to run and debug just a single test in VSCode! +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. ![Shows a single test being run using the new Code Lens](images/single-test.gif) -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. +To enable the improved code lens for Pester 5 you need to disable the "Use Legacy Code Lens" setting which is enabled by default. -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! +1. In Visual Studio Code, open **File | Preferences | Settings** (⌘/Ctrl + ,) +2. In the **Settings** window, navigate to the **Extensions | PowerShell** section. +3. Uncheck the **Pester: Use Legacy Code Lens** checkbox. +4. Close the **Settings** window. -**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. +### Output verbosity +You can control the output verbosity level in VSCode output, or let it inherit from PesterPreference. -#### Output verbosity +![Shows a run with normal preference that shows only errors](images/minimal-output.gif) -You can specify verbosity in VSCode, to see normal or detailed output, or to take it from PesterPreference. This also works for Pester 4! +### Navigation -![Shows a run with normal preference that shows only errors](images/minimal-output.gif) +Pester-blocks are recognized by the PowerShell-extension to simplify navigation in your test files. + +- The Outline panle shows an overview of your Pester-blocks.
+ ![Shows a outline of Pester block structure in the sidepanel](images/vscode-outline.png) + +- Your current location in easily identified using breadcrumbs or the sticky scroll features.
+ ![Shows nested blocks as sticky lines above the current line in the editor](images/vscode-breadcrumbs.png) + +- `Context`, `Describe` and `It` blocks are all searchable using Go to symbol commands.
+ ![Shows a search result for Help is found-test using the Go To Symbol in Workspace command](images/vscode-symbol.png) diff --git a/versioned_docs/version-v5/usage/images/vscode-breadcrumbs.png b/versioned_docs/version-v5/usage/images/vscode-breadcrumbs.png new file mode 100644 index 00000000..e0a632c7 Binary files /dev/null and b/versioned_docs/version-v5/usage/images/vscode-breadcrumbs.png differ diff --git a/versioned_docs/version-v5/usage/images/vscode-outline.png b/versioned_docs/version-v5/usage/images/vscode-outline.png new file mode 100644 index 00000000..7dbb3d44 Binary files /dev/null and b/versioned_docs/version-v5/usage/images/vscode-outline.png differ diff --git a/versioned_docs/version-v5/usage/images/vscode-symbol.png b/versioned_docs/version-v5/usage/images/vscode-symbol.png new file mode 100644 index 00000000..37fa0173 Binary files /dev/null and b/versioned_docs/version-v5/usage/images/vscode-symbol.png differ diff --git a/versioned_docs/version-v5/usage/vscode.mdx b/versioned_docs/version-v5/usage/vscode.mdx index a03527c3..7f1bceea 100644 --- a/versioned_docs/version-v5/usage/vscode.mdx +++ b/versioned_docs/version-v5/usage/vscode.mdx @@ -1,22 +1,38 @@ --- -title: VSCode +title: Visual Studio Code description: See how Visual Studio Code and its extensions helps you run and debug your Pester tests directly inside the editor --- -### VSCode improvements +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. -#### Use legacy code lens +### Code lens -With Pester 5 it is finally possible to run and debug just a single test in VSCode! +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. ![Shows a single test being run using the new Code Lens](images/single-test.gif) -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. +To enable the improved code lens for Pester 5 you need to disable the "Use Legacy Code Lens" setting which is enabled by default. -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! +1. In Visual Studio Code, open **File | Preferences | Settings** (⌘/Ctrl + ,) +2. In the **Settings** window, navigate to the **Extensions | PowerShell** section. +3. Uncheck the **Pester: Use Legacy Code Lens** checkbox. +4. Close the **Settings** window. -#### Output verbosity +### Output verbosity -You can specify verbosity in VSCode, to see normal or detailed output, or to take it from PesterPreference. This also works for Pester 4! +You can control the output verbosity level in VSCode output, or let it inherit from PesterPreference. ![Shows a run with normal preference that shows only errors](images/minimal-output.gif) + +### Navigation + +Pester-blocks are recognized by the PowerShell-extension to simplify navigation in your test files. + +- The Outline panle shows an overview of your Pester-blocks.
+ ![Shows a outline of Pester block structure in the sidepanel](images/vscode-outline.png) + +- Your current location in easily identified using breadcrumbs or the sticky scroll features.
+ ![Shows nested blocks as sticky lines above the current line in the editor](images/vscode-breadcrumbs.png) + +- `Context`, `Describe` and `It` blocks are all searchable using Go to symbol commands.
+ ![Shows a search result for Help is found-test using the Go To Symbol in Workspace command](images/vscode-symbol.png)