nubank / matcher-combinators

Library for creating matcher combinator to compare nested data structures
Other
468 stars 23 forks source link

Proposal: annotate colored mismatch information with `expected` and `actual` #161

Closed philomates closed 2 years ago

philomates commented 3 years ago

Mismatch information in a test failure is printed such that the expected data is in yellow and the actual data is in red. I almost always can't remember if yellow is expected or actual. I imagine others encounter the same trouble.

To help us remember what is what, I thought we could annotate the yellow data in a (expected ..) and the red data in (actual ..)

If folks like this idea I'll open a patch for it.

The only downside I can imagine is more information in mismatch output, which could add to cluttered feeling

before

before

after

after

philomates commented 3 years ago

This would also address https://github.com/nubank/matcher-combinators/issues/17

gabrielgiussi commented 3 years ago

I find this helpful and without disadvantages, open a PR!

I almost always can't remember if yellow is expected or actual

I've been there

philomates commented 2 years ago

addressed in https://github.com/nubank/matcher-combinators/pull/163