-
Notifications
You must be signed in to change notification settings - Fork 513
Pester test Context
failures not showing up in Problems window
#2438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@tillig thanks for reporting this issue, we are able to reproduce this. It is not an issue we will likely have the resources to solve in the short term (although we do welcome PRs and can point you in the right direction if you are interested)...it is an issue that may get addressed in the medium term as we will need to make changes to align with Pester 5...thanks! |
This is where the relevant code is: vscode-powershell/package.json Lines 344 to 364 in 50a2611
|
OK, so it sounds like a problem matcher thing to you, too? I can probably take a look at it. |
Done. The issue was in the location (line/file) matching part. Submitted a PR for that. |
Issue Description
If you have a Pester test where a
BeforeAll
orAfterAll
block fails that failure doesn't show up in the Problems window. Test failures do properly display.Here's a repro test you can use to try it out:
The output of this in the console looks like:
The Problems window does display the test failure - 'has two failures - context and test' but it does NOT display the failure in the test context itself.
If you switch the test above so it's
$True | Should -Be $True
(so there's an assertion and it passes), only the Context will fail. Re-run the test and you'll see there's nothing in the Problem window.Attached Logs
I didn't notice anything in the logs that indicated a failure around this, it appears it's a problem matcher issue. I can gather logs if you think it'd help.
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: