Home > Net >  Disable inline stack trace for failed tests in VS Code
Disable inline stack trace for failed tests in VS Code

Time:11-03

When I run a JUnit test that fails, it fills my entire editor window with the stack trace. It becomes impossible to see the code for the actual test, because it's buried underneath the stack trace.

I'm not sure if it's VS Code that's changed something, or the Test Runner for Java extension (recommended by VS Code) that has changed. Previously, running a test would open a Test Explorer as a separate tab. Any failures would still show the stack trace, but it was very easy to compare the stack trace to the code side by side. Is there a way to re-enable this behavior?

CodePudding user response:

There's a similar issue put in vscode/java-test: [Request] Hide the JUnit Callstack from the stacktrace.

You may comment there to describe your needs and follow up it for solution.

CodePudding user response:

Start from the 0.31.0, the Test Runner for Java extension migrates to the VS Code native testing API. That's why you observed such big UX changes.

Now, if you don't want to show those test messages automatically after running, you can set the setting testing.automaticallyOpenPeekView to never.

  • Related