是否可以在 cli 报告中仅显示 Mocha 测试套件的摘要?
Is it possible to show only the summary of a Mocha test suite in the cli report?
我 运行 我的摩卡测试使用以下命令:
mocha --compilers js:babel-core/register --recursive --colors --watch
测试工作完美,但我对终端中报告的外观不满意。对于 TDD 方法,我想事先编写大量测试,但都失败了,然后开始编写使它们通过的代码。
现在我在顶部看到测试结果摘要,然后是每个失败测试的详细信息。我想在最后看到摘要,这样我就不用每次都在终端上滚动查看了。
如何将摘要移动到底部?
我可以制作一个仅显示摘要的单独测试命令吗?
感谢您的帮助
您看到的是默认报告者spec:
This is the default reporter. The “spec” reporter outputs a hierarchical view nested just as the test cases are.
如果您有很多测试,规范报告程序的输出很容易填满您的控制台中的几页。你可能想要的是一个更紧凑的测试报告器,比如 dot-matrix
The dot matrix (or “dot”) reporter is simply a series of characters which represent test cases. Failures highlight in red exclamation marks (!), pending tests with a blue comma (,), and slow tests as yellow. Good if you prefer minimal output.
可以用mocha -R dot
调用点阵记者
我 运行 我的摩卡测试使用以下命令:
mocha --compilers js:babel-core/register --recursive --colors --watch
测试工作完美,但我对终端中报告的外观不满意。对于 TDD 方法,我想事先编写大量测试,但都失败了,然后开始编写使它们通过的代码。
现在我在顶部看到测试结果摘要,然后是每个失败测试的详细信息。我想在最后看到摘要,这样我就不用每次都在终端上滚动查看了。
如何将摘要移动到底部? 我可以制作一个仅显示摘要的单独测试命令吗?
感谢您的帮助
您看到的是默认报告者spec:
This is the default reporter. The “spec” reporter outputs a hierarchical view nested just as the test cases are.
如果您有很多测试,规范报告程序的输出很容易填满您的控制台中的几页。你可能想要的是一个更紧凑的测试报告器,比如 dot-matrix
The dot matrix (or “dot”) reporter is simply a series of characters which represent test cases. Failures highlight in red exclamation marks (!), pending tests with a blue comma (,), and slow tests as yellow. Good if you prefer minimal output.
可以用mocha -R dot