I run my Mocha tests using the following command:
mocha --compilers js:babel-core/register --recursive --colors --watch
The tests work perfectly, but I am not satisfied with the look of the report in the terminal. For a TDD approach I want to write a lot of tests beforehand that all fail, then make start to write the code that makes them pass.
Right now I get the summary of test results on top, then details for every failed test. I want to see the summary at the end, so I don't have to scroll through the terminal every time I check.
How can I move the summary to the bottom? Can I make a separate test command that ONLY shows the summary?
Thanks for any help
What you are seeing is the default reporter spec:
This is the default reporter. The “spec” reporter outputs a hierarchical view nested just as the test cases are.
If you have lots of tests the output from the spec reporter can easily fill several pages in your console. What you probably want is a more compact test reporter, like 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.
You can call the dot matrix reporter with mocha -R dot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With