avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

mini reporter should surface failures faster. #653

Closed jamestalmage closed 4 years ago

jamestalmage commented 8 years ago

Issuehunt badges

From https://github.com/sindresorhus/ava/pull/618#issuecomment-193960009

For most test suites, the mini reporter just spits out test titles faster than the human eye can process. This gives you warm fuzzies knowing that things are actually happening, but it's not super useful. Which test failed is generally the most valuable feedback your test suite gives you, so it seems silly to make users wait until all the tests have run to deliver valuable information we already have.

My first idea was that, in addition to the current test, the reporter should persist the title of the most recent failure. This would work well if there was a single failure early on, but not so good if there were lots of failures, rapid fire, throughout the test run.

_UPDATE: _ We are going with @vdemedes solution here: https://github.com/sindresorhus/ava/issues/653#issuecomment-198668213

I now think we could do this even better by processing keys from stdin, I am thinking something like the following:


IssueHunt Summary #### [m5x5 m5x5](https://issuehunt.io/u/m5x5) has been rewarded. ### Backers (Total: $60.00) - [issuehunt issuehunt](https://issuehunt.io/u/issuehunt) ($60.00) ### Submitted pull Requests - [#2488 Consolidate mini and verbose reporter](https://issuehunt.io/r/avajs/ava/pull/2488) --- ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/avajs/ava/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds.
novemberborn commented 8 years ago

This would only be useful for test suites that take a really long time to execute though, right?

vadimdemedes commented 8 years ago

I appreciate your time & effort that went into thinking this approach through, but I must say I'm a bit skeptical about having to navigate the test results. Interactive test results would complicate the UX, imo.

jamestalmage commented 8 years ago

This would only be useful for test suites that take a really long time to execute though, right?

Yep.

Interactive test results would complicate the UX, imo

If the user doesn't take action (by hitting :arrow_up:) the experience doesn't change.


I just want to get the important information (test failures) to the user as quickly as possible. Happy to entertain alternative ways to do that.

vadimdemedes commented 8 years ago

I've got an idea, will post a demo soon.

vadimdemedes commented 8 years ago

If an error is encountered, it gets displayed immediately and live test counter moves down. That way user does not need to wait for tests to complete to see the errors & their stacks.

demo

sindresorhus commented 8 years ago

@vdemedes I like this!

novemberborn commented 8 years ago

@vdemedes yea, output errors as they occur but otherwise remain "mini".

jamestalmage commented 8 years ago

:+1:

novemberborn commented 8 years ago

@vdemedes I can't recall whether you made the change you suggested above. Perhaps you could open an issue for it?


Do we want to keep this ticket open at all? It's pretty far out there :stuck_out_tongue_winking_eye:

jamestalmage commented 8 years ago

Let's leave this open - my first idea wasn't great - but @vdemedes plan is. I'll update the description to say we've agreed on @vdemedes plan.

vadimdemedes commented 8 years ago

@novemberborn totally forgot about this one, will submit my fix as a PR soon.

IssueHuntBot commented 5 years ago

@issuehunt has funded $60.00 to this issue.


issuehunt-oss[bot] commented 2 years ago

@sindresorhus has rewarded $54.00 to @m5x5. See it on IssueHunt