Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Commit e2f0a08

Browse files
committed
docs: update with new --color option
1 parent 231a9a7 commit e2f0a08

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Test runner for testing TypeScript typings (CLI over
1111
- :mag: [Glob][intro_fast-glob] pattern matching
1212
- :white_check_mark: [TAP][intro_tap] compatible output
1313

14-
![tsd-lite-cli default tap output](docs/reporter-tap.png "tsd-lite-cli default tap output")
14+
![tsd-lite-cli default colored tap output](docs/default-output.png "tsd-lite-cli default colored tap output")
1515

1616
[intro_tsd]: https://github.com/SamVerschueren/tsd
1717
[intro_tsd-lite]: https://github.com/mrazauskas/tsd-lite
@@ -26,7 +26,7 @@ Test runner for testing TypeScript typings (CLI over
2626
- [Usage](#usage)
2727
- [Example typing test file](#example-typing-test-file)
2828
- [CLI interface](#cli-interface)
29-
- [Reporters](#reporters)
29+
- [`--color` and `--no-color`](#--color-and---no-color)
3030
- [Similar projects](#similar-projects)
3131
- [Changelog](#changelog)
3232

@@ -66,31 +66,34 @@ For more information, see [tsd-lite][example_tsd-lite] for assertion syntax.
6666

6767
## CLI interface
6868

69-
```console
70-
$ npx tsd-lite --help
71-
69+
```shell-session
7270
Usage: tsd-lite [options] <patterns...>
7371
7472
Test runner for testing TypeScript typings (CLI over tsd-lite, a "per file"
7573
version of tsd)
7674
7775
Arguments:
78-
patterns Glob patterns for matching test files
76+
patterns Glob patterns for matching test files
7977
8078
Options:
81-
-v, --version Print version number
82-
-r, --reporter <name> Print test results using reporter
83-
(choices: "tap", "fancy", default: "tap")
84-
-h, --help Print this help guide
79+
-v, --version Print version number
80+
-c, --color Output colored TAP for better human consumption. Disabled in
81+
CI environments if not explicitly set (default: true)
82+
--no-color Disable colored TAP, usefull when piping to other tools
83+
-h, --help Print this help guide
8584
```
8685

87-
### Reporters
86+
### `--color` and `--no-color`
87+
88+
By default, `tsd-lite-cli` outputs a colored version of [Test Anything
89+
Protocol][cli_tap] for better readability. This can be disabled by setting
90+
`--no-color` when piping to other tools like `tap-spec`:
8891

89-
By default, `tsd-lite-cli` writes [Test Anything Protocol][cli_tap] compatible
90-
output, but you can also use the `fancy` reporter, which writes a more
91-
human-friendly output:
92+
```shell-session
93+
npx tsd-lite 'src/**/*.test-d.ts' --no-color | npx tap-spec
94+
```
9295

93-
![tsd-lite-cli fancy output](docs/reporter-fancy.png "tsd-lite-cli fancy output")
96+
![tsd-lite-cli --no-color output piped to tap-spec](docs/output-no-color_tap-spec.png "tsd-lite-cli --no-color output piped to tap-spec")
9497

9598
[cli_tap]: https://testanything.org
9699

bin/tsd-lite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ program
4646
)
4747
.option(
4848
"--no-color",
49-
"Dont output colored TAP, usefull when piping to other tools"
49+
"Disable colored TAP, usefull when piping to other tools"
5050
)
5151
.argument("<patterns...>", "Glob patterns for matching test files")
5252
.action(async (patterns, { color: hasColor }) => {

docs/ouput-default.png

99.5 KB
Loading

docs/ouput-no-color_tap-spec.png

119 KB
Loading

docs/reporter-fancy.png

-47.2 KB
Binary file not shown.

docs/reporter-tap.png

-71.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)