Skip to content

Commit

Permalink
(docs): improve test watch mode docs (#395)
Browse files Browse the repository at this point in the history
- it was not clearly stated that CI=true was what needed to be added,
  so explicitly state that
- similarly, --color was an unnecessary option to pass and may have
  caused confusion, potentially making users believe that it was
  necessary in order to disable watch mode
  - also, --color does not seem to be a valid option of Jest, but
    --colors (note the s) is used to force highlighting in non-TTY

- also, properly format package.json example as JSON, including the
  "scripts" section
- and add a test:watch script for context, making more explicit the
  difference between non-watch and watch mode
  • Loading branch information
agilgur5 authored and swyxio committed Dec 28, 2019
1 parent be3c410 commit 531010e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,16 @@ Examples
This runs Jest v24.x in watch mode. See [https://jestjs.io](https://jestjs.io) for options. If you are using the React template, jest uses the flag `--env=jsdom` by default.
If you would like to disable watch mode, this is one way to do it in your `package.json`:
```
"test": "CI=true tsdx test --color"
"test:coverage": "CI=true tsdx test --color --coverage"
If you would like to disable watch mode, you can set the environment variable `CI=true`. For instance, you could set up your `package.json` `scripts` like:
```json
{
"scripts": {
"test": "CI=true tsdx test",
"test:watch": "tsdx test",
"test:coverage": "CI=true tsdx test --coverage"
}
}
```
### `tsdx lint`
Expand Down

0 comments on commit 531010e

Please sign in to comment.