Improvements for `- expected, + actual` legends
See original GitHub issueFails are reported like this right now:
- expected
+ actual
- ObjectContaining { a: 0 }
+ { a: 0, b: 0 }
For a lot of people, the - expected, + actual legend will not be helpful if it is printed every time. There are already color hints and the - and + signs. And people also get used to reading the reports rather quickly
Ideas for improvements:
Add an option to control the legend (as we may implement different ways to show it)
legend === 'standard'legend === 'compact'
- expected - ObjectContaining { a: 0 }
+ actual + { a: 0, b: 0 }
Check the length of the stringified values, print them as a single line with the legend if there are small enough
legend === 'once'compact + in watch mode, only show the legend on the first error, then later avoid it.legend === 'none'Don’t show itlegend === 'auto'NO_COLOR or CI is present ? ‘compact’ : ‘none’
We don’t need to have all the options, maybe just ‘compact’ and ‘auto’ are good to start with and users may not ask for anything else. And I think we should use ‘auto’ as the default
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
All Upcoming League of Legends Reworks | EarlyGame
Let's take a look at all the reworks Riot is currently working on. Is your favorite champion getting a rework soon?
Read more >Arceus: 10 Things The Next Game Should Improve - CBR
Fans will expect an improved experience that capitalizes on what Legends: Arceus did well and improves or outright removes what it didn't.
Read more >Pokémon Legends: Arceus - Top 8 Improvements To The ...
Pokémon Legends: Arceus introduced multiple new mechanics and took several risks, resulting in a decisive improvement compared to previous ...
Read more >10 Changes To Make Pokemon Legends - Arceus - TheGamer
Despite its warm reception, it's clear that Arceus could be improved in a number of ways. Being the first version of a brand-new...
Read more >Apex Legends™ News and Updates - An Official EA Site
APEX LEGENDS™ BEAST OF PREY COLLECTION EVENT ... From September 20th to October 4th, Play Gun Run - a brand new limited-time mode...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I like that @tony-go, it is what I had in mind for
compact(if the length isn’t needed, better) One detail, I would prefer::, as it could be confused with object notation, just add a few extra spaces and I think is enough to separate the legend from the value (like a table)expectedandactualcould be colored with a darken tone, so the user can focus on the values instead of the legends, and we again better separate the twoMaybe we could start with this, and we don’t need options then as you said. What do you think?
I could give a try on this one ☝🏼 😃