From cf4c982c5685e3d9ae26e3e7a411873aa6d716a9 Mon Sep 17 00:00:00 2001 From: Dragomir Ivanov Date: Mon, 6 Jun 2022 23:11:36 +0300 Subject: [PATCH] docs: add documentation for `--outputTruncateLength` cli flag --- docs/config/index.md | 8 ++++++++ docs/guide/cli.md | 1 + packages/vitest/src/node/cli.ts | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/config/index.md b/docs/config/index.md index 26a4604eb6c8..4bbe51759b89 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -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` diff --git a/docs/guide/cli.md b/docs/guide/cli.md index 57aea9b0c516..08d957a3ac3f 100644 --- a/docs/guide/cli.md +++ b/docs/guide/cli.md @@ -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 ` | Select reporter: `default`, `verbose`, `dot`, `junit`, `json`, or a path to a custom reporter | +| `--outputTruncateLength ` | Truncate output diff lines up to `` number of characters. | | `--outputFile ` | Write test results to a file when the `--reporter=json` or `--reporter=junit` option is also specified
Via [cac's dot notation] you can specify individual outputs for multiple reporters | | `--coverage` | Use c8 for coverage | | `--run` | Do not watch | diff --git a/packages/vitest/src/node/cli.ts b/packages/vitest/src/node/cli.ts index 7c9901723209..4159b33584f1 100644 --- a/packages/vitest/src/node/cli.ts +++ b/packages/vitest/src/node/cli.ts @@ -22,7 +22,7 @@ cli .option('--silent', 'silent console output from tests') .option('--isolate', 'isolate environment for each test file (default: true)') .option('--reporter ', 'reporter') - .option('--outputTruncateLength ', 'diff output length') + .option('--outputTruncateLength ', 'diff output length (default: 80)') .option('--outputFile ', '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')