【问题标题】:Verbose output in jest jsjest js中的详细输出
【发布时间】:2015-08-06 07:44:35
【问题描述】:

是否可以选择详细输出以供开玩笑测试?

我可以看到哪些模块被模拟了。

我试过了

jasmine.VERBOSE = true;

但不工作。

感谢您的回答。

【问题讨论】:

    标签: unit-testing jasmine jestjs


    【解决方案1】:

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

    在你的packages.json,你可以写:

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

    然后你可以运行npm test

    或者,如果您使用gulp-jest,要让Jest 进入详细模式,请在node_modules 中找到gulp-jest 文件夹的index.js 文件,然后在jest.runCLI 块中添加一个verbose: true。

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

    【讨论】:

      【解决方案2】:

      在 package.json 中简单添加

      {
      ...
      ...
      
       "jest": {
               "verbose": true
       },
      ...
      ...
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-04-27
        • 1970-01-01
        • 1970-01-01
        • 2014-11-21
        • 2020-04-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多