question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't run/debug Pester tests using code lens when test has TestCases

See original GitHub issue

System Details

System Details Output
### VSCode version: 1.47.3 91899dcef7b8110878ea59626991a18c8a6a1b3e x64

### VSCode extensions:
adpyke.vscode-sql-formatter@1.4.4
alefragnani.Bookmarks@11.3.1
alefragnani.project-manager@11.1.0
Arjun.swagger-viewer@3.0.1
ban.spellright@3.0.52
bierner.emojisense@0.7.0
bierner.markdown-checkbox@0.1.3
bungcip.better-toml@0.3.2
ckolkman.vscode-postgres@1.1.11
CodeStream.codestream@8.3.1
csholmq.excel-to-markdown-table@1.2.2
dakara.dakara-foldplus@1.4.1
eamodio.gitlens@10.2.2
earshinov.filter-lines@0.2.0
fernandoescolar.vscode-solution-explorer@0.3.10
GehDoc.vscode-textile-preview@1.3.4
GitLab.gitlab-workflow@3.2.0
Gruntfuggly.align-mode@0.0.21
Gruntfuggly.todo-tree@0.0.178
IBM.output-colorizer@0.1.2
janjoerke.align-by-regex@1.0.4
jebbs.plantuml@2.13.13
karigari.chat@0.35.0
karunamurti.haml@1.3.0
lacroixdavid1.vscode-format-context-menu@1.0.4
lextudio.restructuredtext@129.0.0
lonefy.vscode-JS-CSS-HTML-formatter@0.2.3
ms-azuretools.vscode-docker@1.4.1
ms-dotnettools.csharp@1.23.0
ms-vscode-remote.remote-containers@0.128.0
ms-vscode.hexeditor@1.2.1
ms-vscode.powershell@2020.6.0
ms-vsliveshare.vsliveshare@1.0.2478
octref.vetur@0.26.1
rebornix.ruby@0.27.0
redhat.vscode-xml@0.13.0
redhat.vscode-yaml@0.9.1
Shan.code-settings-sync@3.4.3
shuworks.vscode-table-formatter@1.2.1
slevesque.vscode-autohotkey@0.2.2
tomoki1207.pdf@1.1.0
usernamehw.remove-empty-lines@0.0.6
vsls-contrib.codetour@0.0.34
vsls-contrib.gistfs@0.1.8
wayou.vscode-todo-highlight@1.0.4
wingrunr21.vscode-ruby@0.27.0
wwm.better-align@1.1.6
yzane.markdown-pdf@1.4.4
yzhang.markdown-all-in-one@3.2.0


### PSES version: 2.2.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

When Pester test has TestCases, it can’t be run with Run test or Debug test. The test runs normally when Pester is invoked (or using F5).

Expected Behaviour

It should run.

Actual Behaviour

The vs code shows Tests Passed: 0, Failed: 0, Skipped: 0

In the bellow screenshot, the output of using Run test is shown

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
majkinetorcommented, Sep 3, 2020

Thanks, it works.

1reaction
nohwndcommented, Sep 3, 2020

Testcases fixed in Pester 5.0.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debug / Run part of unit test CodeLens for is not showing
Create new unit test project, build it. Debug / Run part of unit test CodeLens for is not showing. Fixed In: Visual Studio...
Read more >
VSCode | Pester
With Pester 5 it is finally possible to run and debug just a single test in VSCode! Shows a single test being run...
Read more >
testing – James Pearson
Running one or more tests – regardless of where you run them from (Test Explorer, Command Palette, CodeLens, Keyboard Shortcut) – will start...
Read more >
Debugging PowerShell Modules with Pester Unit Tests in ...
If you are the author of a PowerShell module, you can use the built- in debugging tools in Microsoft Visual Studio Code to...
Read more >
All Tests With Variables Are Failing In Pester - ADocLib
In computer programming unit testing is a software testing method by which ... That's why they include the Run/Debug Tests code lens shortcuts...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found