Skip to content
← Back to Community
How do I hide Stack Trace from console output for unit tests in Teams for Education?
Profile icon
CatherineWalker

Screen Shot 2021-04-12 at 11.37.07 AM
When students run the tests they get my custom message, one useful line stating the expected versus actual, then a whole bunch of stuff that they don't need. The stack trace report makes the console output cluttered and is confusing my students. Specifically in my Team for Education with the built-in test feature, how do I hide the stack trace?

Voters
Profile icon
SteveAronson
Profile icon
CatherineWalker
Comments
hotnewtop
Profile icon
Bookie0

According to this StackOverflow page, you can't.

But:

It is not possible to disable all stacktraces. You can disable stracktraces for exception classes that you define yourself, by overriding Throwable.fillInStackTrace() to do nothing. But that won't work for classes that you cannot change.

Check it out for more detail.

Good luck! :D