Skip to content

Commit b54eafa

Browse files
mk-61sindresorhus
authored andcommitted
add new reporters section in the readme (#955)
1 parent a539c7e commit b54eafa

File tree

1 file changed

+36
-26
lines changed

1 file changed

+36
-26
lines changed

readme.md

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/rea
1616

1717
- [Usage](#usage)
1818
- [CLI Usage](#cli)
19+
- [Reporters](#reporters)
1920
- [Configuration](#configuration)
2021
- [Documentation](#documentation)
2122
- [API](#api)
@@ -42,7 +43,7 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/rea
4243
- [Async function support](#async-function-support)
4344
- [Observable support](#observable-support)
4445
- [Enhanced assertion messages](#enhanced-assertion-messages)
45-
- [Optional TAP output](#optional-tap-output)
46+
- [TAP reporter](#tap-reporter)
4647
- [Clean stack traces](#clean-stack-traces)
4748

4849
## Test syntax
@@ -129,8 +130,6 @@ AVA comes with an intelligent watch mode. [Learn more in its recipe](docs/recipe
129130

130131
## CLI
131132

132-
![](media/screenshot-mini-reporter.gif)
133-
134133
```console
135134
$ ava --help
136135

@@ -169,6 +168,39 @@ Directories are recursed, with all `*.js` files being treated as test files. Dir
169168

170169
When using `npm test`, you can pass positional arguments directly `npm test test2.js`, but flags needs to be passed like `npm test -- --verbose`.
171170

171+
## Reporters
172+
173+
### Mini-reporter
174+
175+
The mini-reporter is the default reporter.
176+
177+
![](media/screenshot-mini-reporter.gif)
178+
179+
### Verbose reporter
180+
181+
The verbose reporter is always used in CI environments unless [`--tap`](#tap-reporter) is specified. Use the [`--verbose` flag](#verbose-reporter) to enable verbose output.
182+
183+
<img src="media/screenshot.png" width="150">
184+
185+
### TAP reporter
186+
187+
AVA supports the TAP format and thus is compatible with any [TAP reporter](https://github.com/sindresorhus/awesome-tap#reporters). Use the [`--tap` flag](#tap-reporter) to enable TAP output.
188+
189+
```console
190+
$ ava --tap | tap-nyan
191+
```
192+
193+
<img src="media/tap-output.png" width="398">
194+
195+
Please note that the TAP reporter is unavailable when using [watch mode](#watch-it).
196+
197+
### Clean stack traces
198+
199+
AVA automatically removes unrelated lines in stack traces, allowing you to find the source of an error much faster.
200+
201+
<img src="media/stack-traces.png" width="300">
202+
203+
172204
## Configuration
173205

174206
All of the CLI options can be configured in the `ava` section of your `package.json`. This allows you to modify the default behavior of the `ava` command, so you don't have to repeatedly type the same options on the command prompt.
@@ -641,7 +673,7 @@ You can customize how AVA transpiles the test files through the `babel` option i
641673

642674
You can also use the special `"inherit"` keyword. This makes AVA defer to the Babel config in your [`.babelrc` or `package.json` file](https://babeljs.io/docs/usage/babelrc/). This way your test files will be transpiled using the same config as your source files without having to repeat it just for AVA:
643675

644-
```json
676+
```json
645677
{
646678
"babel": {
647679
"presets": [
@@ -743,24 +775,6 @@ test.cb(t => {
743775
});
744776
```
745777

746-
### Optional TAP output
747-
748-
AVA can generate TAP output via `--tap` option for use with any [TAP reporter](https://github.com/sindresorhus/awesome-tap#reporters).
749-
750-
```console
751-
$ ava --tap | tap-nyan
752-
```
753-
754-
<img src="media/tap-output.png" width="398">
755-
756-
Please note that the TAP reporter is unavailable when using [watch mode](#watch-it).
757-
758-
### Clean stack traces
759-
760-
AVA automatically removes unrelated lines in stack traces, allowing you to find the source of an error much faster.
761-
762-
<img src="media/stack-traces.png" width="300">
763-
764778
### Global timeout
765779

766780
A global timeout can be set via the `--timeout` option.
@@ -982,10 +996,6 @@ Tape and tap are pretty good. AVA is highly inspired by their syntax. They too e
982996

983997
In contrast AVA is highly opinionated and runs tests concurrently, with a separate process for each test file. Its default reporter is easy on the eyes and yet AVA still supports TAP output through a CLI flag.
984998

985-
### How can I use custom reporters?
986-
987-
AVA supports the TAP format and thus is compatible with any [TAP reporter](https://github.com/sindresorhus/awesome-tap#reporters). Use the [`--tap` flag](#optional-tap-output) to enable TAP output.
988-
989999
### How is the name written and pronounced?
9901000

9911001
AVA, not Ava or ava. Pronounced [`/ˈeɪvə/` ay-və](media/pronunciation.m4a?raw=true).

0 commit comments

Comments
 (0)