Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verbose output in jest js

is any option for verbore output for testing by jest?

I can see which modules are mocked.

I tried

jasmine.VERBOSE = true;

but not working.

Thanks for answer.

like image 239
hop Avatar asked May 24 '15 20:05

hop


People also ask

Can I console log in Jest?

Jest by default prints all console. log (warnings, errors, etc) messages to the console. That's great – it helps you understand what's going on in your code when tests run.

Does Jest cache test results?

Even distribution of test suites across workers If you're running your test suites in parallel (enabled by default), jest will cache information about how long each of your test suites takes to run.


2 Answers

To get verbose mode in Jest, you can run Jest with the --verbose tag.

In your packages.json, you can write:

"scripts": {
  "test": "jest --verbose"
 },

Then you can run npm test

Alternatively, if you are using gulp-jest, to get Jest in verbose mode, find the index.js file of the gulp-jest folder in node_modules and add a verbose: true to the jest.runCLI block.

jest.runCLI({
  config: options,
  verbose: true
}
like image 165
Jonathan Huang Avatar answered Sep 18 '22 05:09

Jonathan Huang


simple add in package.json

{
...
...

 "jest": {
         "verbose": true
 },
...
...
}
like image 38
Denis Rudov Avatar answered Sep 21 '22 05:09

Denis Rudov