首页 > 解决方案 > Force mocha to always show "diffs"... even for passing tests?

问题描述

So, upon failing a test, mocha will display the "expected" and "actual" values of your assertion, i.e...

AssertionError: expected 3 to be 4
  actual expected
  3      4

Useful. However, when all is going well, and your tests are passing.. no such info is displayed. Regardless of whether or not you supply the --inline-diffs option, you simply get...

 ✓ your goddamn test passed

 1 passing (69ms)

Is it possibly to cajole, persuade, or coax mocha into displaying the former's more descriptive details of the test's "intermediate values", even if the results pass? Like...

 ✓ your goddamn test passed (result was 4)

标签: javascriptnode.jsunit-testingloggingmocha.js

解决方案


推荐阅读