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: removing node-inspector references
  • Loading branch information
mattmorgis committed Aug 31, 2017
commit abc6143637b160053468f5c57bb826b7c3b5e255
16 changes: 5 additions & 11 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1484,13 +1484,7 @@ If you use [Visual Studio Code](https://code.visualstudio.com), there is a [Jest

There are various ways to setup a debugger for your Jest tests. We cover debugging in Chrome and Visual Studio Code.

### Chrome & Node Inspector

Download [Node Inspector](https://github.com/node-inspector/node-inspector) or similar debugger

```bash
npm install -g node-inspector
```
### Chrome

Place `debugger;` statements in any test and run

Expand All @@ -1506,12 +1500,12 @@ node node_modules/bin/react-scripts --inspect-brk test --runInBand --testPathIgn

This will start running your Jest tests, but pause before executing to allow a debugger to attach to the process.

To attach the `node-inspector` debugger, run:
Open the following in Chrome
```
node-inspector
about:inspect
```

This will output a link that you can open in Chrome. After opening that link, the Chrome Developer Tools will be displayed, and a breakpoint will be set at the first line of the Jest CLI script (this is done simply to give you time to open the developer tools and to prevent Jest from executing before you have time to do so). Click the button that looks like a "play" button in the upper right hand side of the screen to continue execution. When Jest executes the test that contains the debugger statement, execution will pause and you can examine the current scope and call stack.
After opening that link, the Chrome Developer Tools will be displayed. Select `inspect` on your process and a breakpoint will be set at the first line of the react script (this is done simply to give you time to open the developer tools and to prevent Jest from executing before you have time to do so). Click the button that looks like a "play" button in the upper right hand side of the screen to continue execution. When Jest executes the test that contains the debugger statement, execution will pause and you can examine the current scope and call stack.

>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.

Expand All @@ -1528,7 +1522,7 @@ Use the following [`launch.json`](https://code.visualstudio.com/docs/editor/debu
"name": "Debug CRA Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot/node_modules/.bin/react-scripts",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
"runtimeArgs": [
"--inspect-brk",
"test"
Expand Down