Skip to content
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

Shift peek for test failures to appear on the line where the test failure occurred #98

Closed
chiefmyron opened this issue May 4, 2024 · 3 comments · Fixed by #100
Closed
Assignees
Labels
enhancement New feature or request

Comments

@chiefmyron
Copy link
Owner

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.

Originally posted by @macbookandrew in #26 (comment)

@macbookandrew
Copy link

Awesome — thanks!!

I’m seeing it show up on the wrong line though, I think because it’s using the last line of the stacktrace rather than the last line of code in my actual app:

SCR-20240506-iyhd

@chiefmyron
Copy link
Owner Author

Hmm, this looks like something specific to the 10.x release of Laravel, which is why I missed it. Essentially, the Illuminate\Foundation\Testing\TestCase class is extending the runTest() method of the base PHPUnit TestCase class, and so the failure is bubbled up through that class. This method is not extended in the v11.x branch, or v9.x and earlier branches - it is specific only to v10.x.

Will have to check the full set of items in the stack to associate the last message reported against the test class file, rather than relying on it always being the last item in the stack.

@macbookandrew
Copy link

this looks like something specific to the 10.x release of Laravel, which is why I missed it. Essentially, the Illuminate\Foundation\Testing\TestCase class is extending the runTest() method of the base PHPUnit TestCase class, and so the failure is bubbled up through that class. This method is not extended in the v11.x branch, or v9.x and earlier branches - it is specific only to v10.x.

oh, interesting…that makes sense. We’ll be upgrading this specific app soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants