Verbose output in jest js

时间:2015-05-24 20:25:06

标签: unit-testing jasmine jestjs

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.

2 个答案:

答案 0 :(得分:33)

要在Jest中获取详细模式,您可以使用--verbose标记运行Jest。

packages.json中,您可以写:

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

然后您可以运行npm test

或者,如果您使用的是gulp-jest,要使Jest处于详细模式,请在index.js中找到gulp-jest文件夹的node_modules文件并添加详细信息:true到jest.runCLI区块。

jest.runCLI({
  config: options,
  verbose: true
}

答案 1 :(得分:9)

简单添加package.json

{
...
...

 "jest": {
         "verbose": true
 },
...
...
}
相关问题