Skip to content

Commit

Permalink
docs: add documentation for --outputTruncateLength cli flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragomir-Ivanov committed Jun 7, 2022
1 parent 24af3fe commit cf4c982
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/config/index.md
Expand Up @@ -237,6 +237,14 @@ Custom reporters for output. Reporters can be [a Reporter instance](https://gith
- `'json'` - give a simple JSON summary
- path of a custom reporter (e.g. `'./path/to/reporter.ts'`, `'@scope/reporter'`)

### outputTruncateLength

- **Type:** `number`
- **Default:** `80`

Truncate output diff lines up to `80` number of characters. You may wish to tune this,
depending on you terminal window width.

### outputFile

- **Type:** `string | Record<string, string>`
Expand Down
1 change: 1 addition & 0 deletions docs/guide/cli.md
Expand Up @@ -54,6 +54,7 @@ vitest related /src/index.ts /src/hello-world.js
| `--silent` | Silent console output from tests |
| `--isolate` | Isolate environment for each test file (default: `true`) |
| `--reporter <name>` | Select reporter: `default`, `verbose`, `dot`, `junit`, `json`, or a path to a custom reporter |
| `--outputTruncateLength <length>` | Truncate output diff lines up to `<length>` number of characters. |
| `--outputFile <filename/-s>` | Write test results to a file when the `--reporter=json` or `--reporter=junit` option is also specified <br /> Via [cac's dot notation] you can specify individual outputs for multiple reporters |
| `--coverage` | Use c8 for coverage |
| `--run` | Do not watch |
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/node/cli.ts
Expand Up @@ -22,7 +22,7 @@ cli
.option('--silent', 'silent console output from tests')
.option('--isolate', 'isolate environment for each test file (default: true)')
.option('--reporter <name>', 'reporter')
.option('--outputTruncateLength <length>', 'diff output length')
.option('--outputTruncateLength <length>', 'diff output length (default: 80)')
.option('--outputFile <filename/-s>', 'write test results to a file when the --reporter=json or --reporter=junit option is also specified, use cac\'s dot notation for individual outputs of mutliple reporters')
.option('--coverage', 'use c8 for coverage')
.option('--run', 'do not watch')
Expand Down

0 comments on commit cf4c982

Please sign in to comment.