From 531010e38fba9e948a0b8638c031266a925a4df0 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Fri, 27 Dec 2019 22:32:08 -0500 Subject: [PATCH] (docs): improve test watch mode docs (#395) - 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 --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7fd7a110d..e187ef5f3 100644 --- a/README.md +++ b/README.md @@ -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`