expecto icon indicating copy to clipboard operation
expecto copied to clipboard

Separate exceptions/debug values/values from pretty printing

Open daniellittledev opened this issue 4 years ago • 6 comments

Expecto Assert Exceptions are hard to read in the debugger

The Expecto Assertions throw exceptions which have color codes in the exception message. Sometimes you see these strings directly instead of via the console however the codes make the message unreadable.

Is there a way to turn colors off for assert exceptions?

daniellittledev avatar Oct 24 '19 22:10 daniellittledev

It's not something currently supported; it would entail refactoring to more structured messaging and value passing. If you want to have a go at it, it could be rolled into a future release.

haf avatar Oct 25 '19 07:10 haf

Opening again, we want to do this.

haf avatar Oct 26 '19 11:10 haf

I might be able to help, if no one else beats me to it. Where are the messages formatted, I had trouble tracking it down?

daniellittledev avatar Oct 26 '19 11:10 daniellittledev

The messages are formatted in the Expect.{method} and printed as-is to the logger, so you'll have to refactor all asserts that pretty-print. See the commits of https://github.com/haf/expecto/pull/346

haf avatar Oct 26 '19 11:10 haf

@daniellittledev We've just merged a PR which might be easier to base your own work on, should you wish to pick this up.

haf avatar Apr 04 '20 09:04 haf

@haf thanks, good to know

daniellittledev avatar Apr 05 '20 00:04 daniellittledev