chiefmyron / phpunit-test-workbench

An extension to integrate PHPUnit with the native Test Explorer functionality within VS Code. Zero configuration required for common environment setups.
https://marketplace.visualstudio.com/items?itemName=chiefmyron.phpunit-test-workbench
MIT License
5 stars 2 forks source link

Highlight lines within test methods where test failures occur #26

Closed chiefmyron closed 2 years ago

chiefmyron commented 2 years ago

Failed assertions will give sufficient detail that the specific line causing the error can be highlighted.

In the case of failed assertions, the failure detail contains only the file path and line number: image

In the case of an exception, the failure detail contains an abbreviated call stack that includes line numbers: image

macbookandrew commented 5 months ago

@chiefmyron I just started using the extension today and looks like this feature stopped working, or isn’t working in my (Laravel) environment for some reason.

Any specific suggestions of what I could do to troubleshoot and find the problem?

chiefmyron commented 5 months ago

Hi @macbookandrew - thanks for giving the extension a try! This feature is now behind a setting, and is turned off by default:

image

Changing the phpunit-test-workbench.log.displayFailuresAsErrorsInCode setting to true should start to show failed assertions as highlighted errors within the code.

macbookandrew commented 5 months ago

Ah, thanks. It does, but apparently not for chained assertions.

I guess this is more of a feature request too: would it be possible to display the “peek” panel at the failed line too?

SCR-20240502-sclq

Here’s how another plugin I’ve used shows failures:

SCR-20240502-sgxb

I’ve not really worked on VS Code extensions before, but if you can point me where to start, I could take a stab at that.

chiefmyron commented 5 months ago

That would be a really good improvement - I've created a new ticket to implement it. The good news is it shouldn't take too much to do.