Custom format for assertion exception messages #2218
Unanswered
eylvisaker
asked this question in
Q&A
Replies: 1 comment
-
No, unfortunately not. The "because" part is part of a hard-coded template that is specific for every assertion. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to customize the format of the exception messages? In particular I would like to move the "because" clause to the end.
I get a lot of failed tests with messages that look like this:
but I feel they would read much more naturally like this:
Sometimes it's really hard to craft good, concise "should succeed because" clause to explain why an assertion is true, but it's very easy to to automatically have a concise, helpful message that "but failed because" clause. A format with the "because" at the end would read well in either case.
Beta Was this translation helpful? Give feedback.
All reactions