Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to improve console output when running tests?

Tags:

testing

jestjs

Is there a way to see better console output when running tests using Jest?

Everytime a test fails, regardless of the issue I only see the following output in the console

Found 1 matching tests...
FAIL  test\jestTests\xxx.spec.js (1.468s)
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

Furthermore, if all tests in a file pass the only output I see is the following

Found 1 matching tests...
PASS  test\jestTests\xxx.spec.js (1.716s)

I thought I might get better output if I set

 jasmine.VERBOSE = true;

but that doesn't seem to change anything. It seems strange that you don't get much more that this with the default config. Am I doing something wrong here?

like image 415
Ron Avatar asked Aug 05 '14 14:08

Ron


1 Answers

Had the same problem. It's actually a bug, and a weird one. Found the answer here https://github.com/facebook/jest/issues/110 After I commented that line in the bin/jest file I can now see proper logs.

like image 115
user3089094 Avatar answered Sep 25 '22 18:09

user3089094