diff --git a/docs/images/test-duration-range.png b/docs/images/test-duration-range.png new file mode 100644 index 0000000000..26dcfc0460 Binary files /dev/null and b/docs/images/test-duration-range.png differ diff --git a/docs/index.md b/docs/index.md index b50cd41952..2e256c8910 100644 --- a/docs/index.md +++ b/docs/index.md @@ -707,10 +707,18 @@ $ mocha

Test duration

-Many reporters will display test duration, as well as flagging tests that are slow, as shown here with the "spec" reporter: +Many reporters will display test duration and flag tests that are slow (default: 75ms), as shown here with the "spec" reporter: ![test duration](images/reporter-spec-duration.png?withoutEnlargement&resize=920,9999){:class="screenshot"} +There are three levels of test duration (depicted in the following image): + +1. FAST: Tests that run within half of the "slow" threshold will show the duration in green (if at all). +2. NORMAL: Tests that run exceeding half of the threshold (but still within it) will show the duration in yellow. +3. SLOW: Tests that run exceeding the threshold will show the duration in red. + +![test duration range](images/test-duration-range.png?withoutEnlargement&resize=920,9999){:class="screenshot"} + To tweak what's considered "slow", you can use the `slow()` method: ```js