haf / expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Apache License 2.0
663 stars 96 forks source link

Separate exceptions/debug values/values from pretty printing #357

Open daniellittledev opened 4 years ago

daniellittledev commented 4 years ago

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?

haf commented 4 years ago

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 commented 4 years ago

Opening again, we want to do this.

daniellittledev commented 4 years ago

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?

haf commented 4 years ago

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 commented 4 years ago

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

daniellittledev commented 4 years ago

@haf thanks, good to know