Jest: Have a mode to print out a line for each test that's run

Created on 14 May 2014  路  13Comments  路  Source: facebook/jest

More fun that way (instead of just the filename).

Most helpful comment

Not sure this was addressed. If I use verbose on some slow integration tests... it waits till all tests are run in that one file before it outputs the results. Is there a way to see each test as it passes in the suite/file?

All 13 comments

I support this -- but it might be good to have it toggeable via an option to make grepping the output results still possible

I might not be talking about the same thing, but if I am I think this is a great idea. Printing out each test run (or at least having a verbose option) might make the use of the word "test" a bit clearer.

For example:

Found 2 matching tests...
PASS __tests__/foo.js (0.02s)
PASS __tests__/bar.js (0.08s)
2 tests passed (2 total)
Run time: 1.236s

While there are 2 test _files_, some (including myself) might think of each it() call to be a test, in which case there is no way to see a list of all the tests being run. That or a test count:

Found 2 test files...
PASS __tests__/foo.js (4 tests in 0.02s)
PASS __tests__/bar.js (21 tests in 0.18s)
25 tests passed (25 total)
Run time: 1.236s

Along these lines, it would also be nice to know how many x'd out tests there are (xit, xdescribe, etc.). x* doesn't cause a test file to fail, so if everything else about the file passes then it's essentially invisible in the test results.

I can think of a couple of cases where you'd want to know it was there, like if you temporarily disabled a failing test but forgot to reenable it later.

Adding to @whymarrh's example:

Found 2 test files...
PASS __tests__/foo.js (4 tests (2 skipped) in 0.02s)
PASS __tests__/bar.js (21 tests in 0.18s)
25 tests passed (25 total, 2 skipped)
Run time: 1.236s

Someone else could surely come up with a better way to display this information, but that should illustrate the point.

This might need a new issue.

Coming from the Angular world this was a bit confusing to begin with. I also would like test to mean how many it() calls even if this isn't on by default.

+1

+1

+1

+1

+1

:+1:

This was fixed by the --verbose option https://github.com/facebook/jest/pull/370

@jaredly is right, I think we can close this issue

Not sure this was addressed. If I use verbose on some slow integration tests... it waits till all tests are run in that one file before it outputs the results. Is there a way to see each test as it passes in the suite/file?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stephenlautier picture stephenlautier  路  3Comments

samzhang111 picture samzhang111  路  3Comments

jardakotesovec picture jardakotesovec  路  3Comments

ticky picture ticky  路  3Comments

withinboredom picture withinboredom  路  3Comments