我可以在mocha输出中隐藏故障详细信息吗?

时间:2018-06-25 22:46:41

标签: javascript mocha

有时候运行一组摩卡测试时,我并不关心失败的细节;我只想要通过或失败的测试列表。我试过几个记者,但他们似乎都输出失败的详细信息。我喜欢默认的规范报告器结构,但是找不到隐藏细节的方法。

这是一个示例。对于这些测试:

const assert = require('assert')
describe('test test', function() {
  it('should pass', function() {

  })
  it('should fail', function() {
    assert(false)
  })
})

哪个给出这样的输出:

  test test
    ✓ should pass
    1) should fail


  1 passing (9ms)
  1 failing

  1) test test
       should fail:

      AssertionError [ERR_ASSERTION]: false == true
      + expected - actual

      -false
      +true

      at Context.<anonymous> (test-solution.js:69:5)

但是我想要的只是这个:

  test test
    ✓ should pass
    1) should fail

  1 passing (9ms)
  1 failing

我错过了明显的东西吗?还是这些细节我无法抑制?

0 个答案:

没有答案