Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: replacing terminal command with npm script
  • Loading branch information
mattmorgis committed Sep 3, 2017
commit b03b7b1b334b4ef18609ec299183f0bf3122cf9e
17 changes: 8 additions & 9 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1486,16 +1486,15 @@ There are various ways to setup a debugger for your Jest tests. We cover debuggi

### Chrome

Place `debugger;` statements in any test and run

macOS/Linux
```bash
node node_modules/.bin/react-scripts --inspect-brk test --runInBand --env=jsdom
Add the following to the `scripts` section in your project's `package.json`
```json
"scripts": {
"test:debug": "react-scripts --inspect-brk test --runInBand --env=jsdom"
}
```

Windows
Place `debugger;` statements in any test and run:
```bash
node node_modules/bin/react-scripts --inspect-brk test --runInBand --testPathIgnorePatterns=ui-tests/* --env=jsdom
$ npm run test:debug
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a general note: instead of a Terminal command, can we suggest adding

  "test:debug": "react-scripts --inspect-brk test --runInBand --env=jsdom"

to scripts in package.json and then ask you to run npm run test:debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is much cleaner. Updated!


This will start running your Jest tests, but pause before executing to allow a debugger to attach to the process.
Expand All @@ -1509,7 +1508,7 @@ After opening that link, the Chrome Developer Tools will be displayed. Select `i

>Note: the --runInBand cli option makes sure Jest runs test in the same process rather than spawning processes for individual tests. Normally Jest parallelizes test runs across processes but it is hard to debug many processes at the same time.

### Visual Studio Code
### Debugging Tests in Visual Studio Code

Debugging Jest tests for `create-react-app` is supported out of the box for [Visual Studio Code](https://code.visualstudio.com).

Expand Down